reset password in Django 1.6

hln

I got an errror when I try to reset my password by use django password reset:

*The current URL, /reset/Nw/3u5-5654a2cadfa432b86577/, didn't match any of these.*

in url.py I have

 urlpatterns+=patterns('',
 url(r'^resetpassword/$', 'django.contrib.auth.views.password_reset',name='password_reset_done'),
 (r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>.+)/$', 'django.contrib.auth.views.password_reset_confirm'),
 (r'^resetpassword/passwordsent/$', 'django.contrib.auth.views.password_reset_done'),
 (r'^reset/done/$', 'django.contrib.auth.views.password_reset_complete'),
 )+static(settings.MEDIA_URL,document_root=settings.MEDIA_ROOT)+staticfiles_urlpatterns()

What can be wrong here?

orokusaki

The problem is that your path begins with 2 slashes, so it's currently //reset/Nw/3u5-5654a2cadfa432b86577/ (when your path begins with just 1 slash, Django doesn't use the first one to match against your pattern, which is why the "URL" it's showing you in the error message only begins with 1 slash).

You probably have something like this in your code: <domain>/{{ obj.path }}

Solution:

Remove the extra slash from the path you're returning, which will result in the path being /reset/Nw/3u5-5654a2cadfa432b86577/.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Password reset django 1.6

From Dev

Reset password in Django

From Dev

NoReverseMatch in Django Password Reset

From Dev

NoReverseMatch in Django Password Reset

From Dev

Password reset django 1.6

From Dev

django password reset password_reset_confirm

From Java

How to reset Django admin password?

From Java

Django password_reset with appname

From Dev

django - reset password views issue

From Dev

django password reset NoReverseMatch error

From Dev

django customize reset password form

From Dev

django password reset NoReverseMatch error

From Dev

Django Password Reset No reverse match

From Dev

Reset admin password for MySQL and Plesk on CentOS 6

From Dev

Django 1.6 - templates for password change/reset

From Dev

Django - NoReverseMatch at /accounts/password_reset/

From Dev

django 1.7.8 not sending emails with password reset

From Dev

NoReverseMatch: in the password reset form in Django-registration?

From Dev

Django password reset - Send mail using celery

From Dev

NoReverseMatch error in password reset functionality django

From Dev

Django: built-in password reset views

From Dev

setting expiration time to django password reset token

From Dev

Django - Move password_reset templates

From Dev

django 1.6.5 password reset email check validlink

From Dev

Django User Registration - Password Reset via email

From Dev

Authenticate user after password reset in Django

From Dev

Overriding Django's reset password email templates

From Dev

Django-allauth password reset link not open

From Dev

python Django reset password URL NoReverseMatch