Skip to content Skip to sidebar Skip to footer

Noreversematch Exception While Resetting Password In Django Using Django's Default Views

I am getting the below error when I am using the 'ResetMyPassword' button Reverse for 'password_reset_confirm' with arguments '()' and keyword arguments '{'uidb64': b'MTI', 'token'

Solution 1:

Your password_reset_confirm URL pattern is out of date. It changed from uidb36 to uidb64 in Django 1.6. It should be:

url(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>.+)/$',
'django.contrib.auth.views.password_reset_confirm',
name='password_reset_confirm'),

Update your password reset email template as well:

{% url 'password_reset_confirm' uidb64=uid token=token %}

In Django 1.8+, you should use the view in your url pattern rather than the string.

from django.contrib.auth.views import password_reset_confirm

urlpatterns = [
    ...
    url(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>.+)/$',
    password_reset_confirm, name='password_reset_confirm'),
    ...
]

Ensure that you

Post a Comment for "Noreversematch Exception While Resetting Password In Django Using Django's Default Views"