xRo*_*bot 12 django django-templates
我已经为500 HTTP错误创建了一个模板.
我已将模板插入500.html
:
但我总是得到这个错误:
TemplateDoesNotExist: 500.html
Run Code Online (Sandbox Code Playgroud)
我遇到HTTP 404错误的相同问题.
为什么?
kaf*_*hau 10
您可能需要在settings.py中指定模板目录(如果尚未指定).
例如在我的settings.py中,我有:
ROOTDIR = os.path.abspath(os.path.dirname(__file__))
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
ROOTDIR + '/logistics/templates',
)
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
24104 次 |
最近记录: |