Skip to content
Advertisement

Django 2.0 – Reverse for ‘password_change_done’ not found. ‘password_change_done’ is not a valid view function or pattern name

I’m having this error message after trying to change my app’s password.

Do you have any idea of what’s causing this route to fail?

Actually, it is changing the password but it isn’t rendering the success template “password_change_done.html”.

Thanks!

app/urls.py

JavaScript

ERROR MESSAGE

JavaScript

app/templates/registration/password_change_form.html

JavaScript

app/templates/registration/password_change_done.html

JavaScript

Thanks for your help!

Advertisement

Answer

I think the problem here is, as Tobit hints, is that your URLs are using an application namespace called account. That has been defined by the presence of app_name = 'account' in your urls.py.

The PasswordChangeView does not expect a namespace when looking up the password_change_done view. However, you can override that in your urls.py by specifying an explicit success_url attribute:

JavaScript

More info on namespaces: https://docs.djangoproject.com/en/2.0/topics/http/urls/#url-namespaces-and-included-urlconfs

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement