【发布时间】:2016-05-06 02:13:34
【问题描述】:
所以我将注册模板的名称从 user_form.html 更改为 register.html。我还在 urls.py 文件中对其进行了更改以反映新名称,但是当我尝试转到注册页面时,我得到以下信息:
Exception Type: TemplateDoesNotExist
Exception Value:web/user_form.html
Template-loader postmortem
Django tried loading these templates, in this order:
Using loader django.template.loaders.filesystem.Loader:
Using loader django.template.loaders.app_directories.Loader:
../swl/root/lib/pythpy2.7.egg/django/contrib/admin/templates/web/user_form.html (File does not exist)
../django/contrib/auth/templates/web/user_form.html (File does not exist)
../templates/web/user_form.html (File does not exist)
..tastypie/templates/web/user_form.html (File does not exist)
../bootstrap3/templates/web/user_form.html (File does not exist)
../web/templates/web/user_form.html (File does not exist)
为什么模板加载器仍然在寻找旧的文件名?
编辑:这是我的注册网址:
url(r'register/?$',
UserCreate.as_view(),
{
'template_name':'accounts/register.html'
},
name = 'register'),
【问题讨论】:
-
显示您在 urls.py 中所做的更改。
标签: python html django templates django-templates