Django: Built-in Password Reset Views
I am following the documentation and I am getting a NoReverseMatch error when I click on the page to restart my password. NoReverseMatch at /resetpassword/ Reverse for 'password_re
Solution 1:
Add the url name to the entry in your urls.py
for password_reset_done
:
(r'^resetpassword/passwordsent/$', 'django.contrib.auth.views.password_reset_done', name='password_reset_done'),
Internally, the password_reset
view uses reverse('password_reset_done')
to look up where to send the user after resetting the password. reverse
can take a string representation of a function name, but it needs to match the form used in your patterns - in this case, it can't match because the full path is specified in your pattern but not in the reverse call. You could import the views from the module and use just their names in the pattern or use a prefix in your patterns if you'd prefer that over the name
argument.
https://docs.djangoproject.com/en/dev/ref/urlresolvers/#django.core.urlresolvers.reverse for the details on reverse
.
Post a Comment for "Django: Built-in Password Reset Views"