I am using Django 1.11 to build an user account application. My urls for my account app is as Code 1 as below. And also I have a templates/registrations folder and several template files there: enter image description here
After I input the email address and I receive the email with the following link: http://127.0.0.1:8000/account/password-reset/confirm/MQ/4ra-66d3672f1d340589fbf9/
I click the above link and the browser redirects to this link: http://127.0.0.1:8000/account/password-reset/confirm/MQ/set-password/
And the error prompts:
NoReverseMatch at /account/password-reset/confirm/MQ/set-password/
Reverse for 'password_reset_confirm' with no arguments not found. 1 pattern(s) tried: ['account/password-reset/confirm/(?P[-\w]+)/(?P[-\w]+)/$']
Request Method: GET
Request URL: http://127.0.0.1:8000/account/password-reset/confirm/MQ/set-password/
Django Version: 1.11.7
Exception Type: NoReverseMatch
Exception Value:
Reverse for 'password_reset_confirm' with no arguments not found. 1 pattern(s) tried: ['account/password-reset/confirm/(?P[-\w]+)/(?P[-\w]+)/$']
Please help me how to solve this problem. It seems that after I click the link, the Django fails to render the password_reset_confirm.html under templates/registration folder.
Code 1:
# restore password urls
url(r'^password-reset/$', auth_views.PasswordResetView.as_view(), name='password_reset'),
url(r'^password-reset/done/$', auth_views.PasswordResetDoneView.as_view(), name='password_reset_done'),
url(r'^password-reset/confirm/(?P<uidb64>[-\w]+)/(?P<token>[-\w]+)/$',
auth_views.PasswordResetConfirmView.as_view(), name='password_reset_confirm'),
url(r'^password-reset/complete/$',
auth_views.PasswordResetCompleteView.as_view(), name='password_reset_complete'),