[Django]-Django NoReverseMatch at /accounts/password/reset/ for password reset

3👍

Change the url in your password_reset_email.html to:

{{ protocol }}://{{ domain }}{% url 'password_reset_confirm' uidb64=uid token=token %}

This is how it is done in the docs

0👍

If you are using Django 1.6 as you are stating than the code you are using is wrong as password reset was changed in Django 1.6.

Please read here https://docs.djangoproject.com/en/1.7/topics/auth/default/#django.contrib.auth.views.password_reset

You must change the template for your password reset email accordingly.

You must also change the urls accordingly

You have now

url(r'^password/reset/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$', 'django.contrib.auth.views.password_reset_confirm',
 {'post_reset_redirect' : '/accounts/password/done/'}),

Should be something like this

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

Leave a comment