我写了密码重置并更改了结构为
的模板 In [10]: !tree /Users/me/desktop/Django/forum/user/templates/user
/Users/me/desktop/Django/forum/user/templates/user
├── activate.html
├── failure.html
├── logged_out.html
├── login.html
├── password_change_done.html
├── password_change_form.html
├── password_reset_complete.html
├── password_reset_confirm.html
├── password_reset_done.html
├── password_reset_email.html
├── password_reset_form.html
├── password_reset_subject.txt
├── register.html
├── success.html
└── validate.html
我在浏览器中测试时会抛出TemplateDoesNotExist
错误
http://127.0.0.1:8001/user/password_reset/
TemplateDoesNotExist at /user/password_reset/
/user/password_reset_form.html
Request Method: GET
Request URL: http://127.0.0.1:8001/user/password_reset/
Django Version: 1.11.13
Exception Type: TemplateDoesNotExist
Exception Value:
/user/password_reset_form.html
所有的密码_ _ 都没有按预期执行,但其他的功能正常。
urls.py
#Costomize the authentication system
urlpatterns = [
# show the register page
url(r"^register/$", views.register, name="register"),
...
url(r'^password_reset/$', auth_views.PasswordResetView.as_view(template_name="/user/password_reset_form.html"), name='password_reset'),
]
我的多个密码模板有什么问题?