Skip to content Skip to sidebar Skip to footer

Noreversematch Error In Password Reset Functionality Django

I am trying to implement password reset funcitonality in django and below are my codes urls.py urlpatterns = patterns('', url(r'^signup/$', 'accounts.views.signup', name='signu

Solution 1:

You need to add that url+view in urls.py as below

url(r'^user/password/reset/confirm/$', 
             'django.contrib.auth.views.password_reset_confirm'),

It presents a form for entering a new password.

You may also have to add this as well

url(r'^user/password/reset/complete/$', 
             'django.contrib.auth.views.password_reset_complete'),

Solution 2:

You can also use the default urls defined in django.contrib.auth.urls by including

(r'^accounts/', include('django.contrib.auth.urls')),

to your urls.py.

The password_reset_confirm pattern require 2 additional parameters for the uidb64 and the token:

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

See also the answer here: What are the default URLs for Django's User Authentication system?

Post a Comment for "Noreversematch Error In Password Reset Functionality Django"