Tuesday, June 28, 2016

Re: How to use password_change function from django.contrib.auth.views

You need a url() with name='password_change_done' -- instead you wrote 'change_password_done'.

On Monday, June 27, 2016 at 11:39:23 AM UTC-4, Juan Sebastian Avila Rodriguez wrote:
I tried to implement the password_change view but is not working. I only add the code below to the urls.py:

from django.contrib.auth import views as auth_views
...
url(          r'^change-password/$',          auth_views.password_change,
        name='change_password'
    ),
url(
        r'^change-password/done$',
        auth_views.password_change_done,
        name='change_password_done'
),
...

In the base.html template. Add the <a> tag with href="{% url 'change_password' %}". When I click on it. I get this error:

NoReverseMatch at /change-password/  Reverse for 'password_change_done' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []

Thank you for your help.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f1e91da0-4b8e-49ca-ac61-49259fb53e25%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment