NoReverseMatch at /accounts/password/reset/confirm

Md. Tanvir Raihan

I am using django userena and getting the error.After submitting the email address for password reset,i am getting a pass reset confirmation mail.The mail body is something like this

You're receiving this e-mail because you requested a password reset
for your user account at example.example.com.

Please go to the following page and choose a new password:

http://example.example.com/accounts/password/reset/confirm/Mg-3xm-add2c70e92d3694c5043/



Your username, in case you've forgotten: ****


Thanks for using our site!

Sincerely,
example.example.com

but after clicking the link to chooise a new password, i am getting the following error

NoReverseMatch at /accounts/password/reset/confirm/Mg-3xm-add2c70e92d3694c5043/
Reverse for 'password_reset_complete' with arguments '()' and keyword arguments '{}' not    found. 0 pattern(s) tried: []
Request Method: GET
Request URL:    http://med.finder-lbs.com/accounts/password/reset/confirm/Mg-3xm-   add2c70e92d3694c5043/
Django Version: 1.6.1
Exception Type: NoReverseMatch
Exception Value:    
Reverse for 'password_reset_complete' with arguments '()' and keyword arguments '{}' not     found. 0 pattern(s) tried: []

urls.py

url(r'^resetpassword/passwordsent/$', 'django.contrib.auth.views.password_reset_done', name='password_reset_done'),
url(r'^password/reset/$',
   auth_views.password_reset,
   {'template_name': 'userena/password_reset_form.html',
    'email_template_name': 'userena/emails/password_reset_message.txt',
    'extra_context': {'without_usernames': userena_settings.USERENA_WITHOUT_USERNAMES}
    },
   name='userena_password_reset'),
url(r'^password/reset/done/$',
   auth_views.password_reset_done,
   {'template_name': 'userena/password_reset_done.html'},
   name='userena_password_reset_done'),
url(r'^user/password/reset/confirm/$',
         'django.contrib.auth.views.password_reset_confirm'),
url(r'^password/reset/confirm/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$',
   auth_views.password_reset_confirm,
   {'template_name': 'userena/password_reset_confirm_form.html'},
   name='userena_password_reset_confirm'),

url(r'^password/reset/confirm/complete/$',
   auth_views.password_reset_complete,
   {'template_name': 'userena/password_reset_complete.html'}),

password_reset_message.txt

{% load i18n %}{% autoescape off %}{% load url from future %}
{% blocktrans %}You're receiving this e-mail because you,requested a password reset
for your user account at {{ site_name }}{% endblocktrans %}.

{% trans "Please go to the following page and choose a new password:" %}
{% block reset_link %}
{{ protocol }}://{{ domain }}{% url 'userena_password_reset_confirm' uidb64=uid   token=token %}
{% endblock %}

{% if not without_usernames %}{% blocktrans with user.username as username %}
Your username, in case you've forgotten: {{ username }}
{% endblocktrans %}
{% endif %}
{% trans "Thanks for using our site!" %}

{% trans "Sincerely" %},
{{ site_name }}
{% endautoescape %}

i am pretty sure something missing here but i can't figure it out.I am using django 1.6

Enrico
# urls.py
url(r'^password/reset/confirm/complete/$',
   auth_views.password_reset_complete,
   {'template_name': 'userena/password_reset_complete.html'},
   name='password_reset_complete') # must be named for reverse to work

Naming the url should solve your NoReverseMatch error.

However, it sounds like you may have another issue, because you describe this error as occurring immediately after you click the reset link, which means that the password_reset_confirm view is trying to redirect the user to password_reset_complete immediately - not after they've chosen a new password.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related