int*_*_32 3 django django-templates
我有这个模板结构:
dir1:base.html dir2:template.html
template.html必须扩展base.html:
{% extends '../dir1/base.html' %}
Run Code Online (Sandbox Code Playgroud)
但它引发了错误:
渲染时抓住TemplateDoesNotExist:../ dir1/base.html
您应该在settings.py中设置模板目录(https://docs.djangoproject.com/en/dev/ref/settings/#template-dirs),然后使用{% extends 'dir/base.html' %}.
| 归档时间: |
|
| 查看次数: |
3210 次 |
| 最近记录: |