urls.py
url(r'^password/reset/$',
PasswordResetView.as_view(
success_url=reverse_lazy('password_reset_done'),
template_name='registration/password_reset_form.html',
email_template_name='registration/password_reset_email.html',
subject_template_name='registration/email/password_reset_subject.txt'
),
name='password_reset'),
url(r'^password/reset/done/$',
PasswordResetDoneView.as_view(
template_name='registration/password_reset_confirm.html'
),
name='password_reset_done'),
错误
Internal Server Error: /accounts/password/reset/done/
Traceback (most recent call last):
File "/lib/python3.5/site-packages/django/core/handlers/exception.py", line 41, in inner
response = get_response(request)
File "/lib/python3.5/site-packages/django/core/handlers/base.py", line 217, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/lib/python3.5/site-packages/django/template/base.py", line 990, in render
bit = node.render_annotated(context)
File "/lib/python3.5/site-packages/django/template/base.py", line 957, in render_annotated
return self.render(context)
File "/lib/python3.5/site-packages/django/template/loader_tags.py", line 177, in render
return compiled_parent._render(context)
File "/lib/python3.5/site-packages/django/template/base.py", line 199, in _render
return self.nodelist.render(context)
File "/lib/python3.5/site-packages/django/template/base.py", line 990, in render
bit = node.render_annotated(context)
File "/lib/python3.5/site-packages/django/template/base.py", line 957, in render_annotated
return self.render(context)
File "/lib/python3.5/site-packages/django/template/loader_tags.py", line 177, in render
return compiled_parent._render(context)
File "/lib/python3.5/site-packages/django/template/base.py", line 199, in _render
return self.nodelist.render(context)
File "/lib/python3.5/site-packages/django/template/base.py", line 990, in render
bit = node.render_annotated(context)
File "/lib/python3.5/site-packages/django/template/base.py", line 957, in render_annotated
return self.render(context)
File "/lib/python3.5/site-packages/django/template/loader_tags.py", line 177, in render
return compiled_parent._render(context)
File "/lib/python3.5/site-packages/django/template/loader_tags.py", line 72, in render
result = block.nodelist.render(context)
File "/lib/python3.5/site-packages/django/template/base.py", line 957, in render_annotated
return self.render(context)
File "/lib/python3.5/site-packages/django/template/loader_tags.py", line 72, in render
result = block.nodelist.render(context)
File "/lib/python3.5/site-packages/django/template/base.py", line 957, in render_annotated
return self.render(context)
File "/lib/python3.5/site-packages/django/template/defaulttags.py", line 458, in render
url = reverse(view_name, args=args, kwargs=kwargs, current_app=current_app)
File "/lib/python3.5/site-packages/django/urls/base.py", line 91, in reverse
return force_text(iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs)))
File "/lib/python3.5/site-packages/django/urls/resolvers.py", line 497, in _reverse_with_prefix
raise NoReverseMatch(msg)
django.urls.exceptions.NoReverseMatch: Reverse for '' not found. '' is not a valid view function or pattern name.
"GET /accounts/password/reset/done/ HTTP/1.1" 500