Home > Software engineering >  Django form not working correctly after psw changing it gives error
Django form not working correctly after psw changing it gives error

Time:07-17

$ the urls.py page, password change done is not working , i trued auth_views to change psw and done view but it gives the following:

error Page

NoReverseMatch at /accounts/settings/change_password
Reverse for 'password_change_done' not found. 'password_change_done' 
is not a valid view function or pattern name.
Request Method: POST
Request URL:     
http://localhost:8000/accounts/settings/change_password
Django Version: 4.0.5
Exception Type: NoReverseMatch
Exception Value:    
Reverse for 'password_change_done' not found. 'password_change_done' 
is not a valid view function or pattern name

urlpatterns = [
 path('settings/change_password',
 auth_views.PasswordChangeView.as_view
 (template_name="accounts/change_psw-dj.html"), name="change_psw"), 
 path('settings/change_password_done', 

 auth_views.PasswordChangeDoneView.as_view
 (template_name="accounts/change_psw_done-dj.html"), 
 name="change_psw_done"),
 ]

CodePudding user response:

You're incorrectly using the url name. Your view or template expects the url to be named password_change_done but you've named it change_psw_done. Change change_psw_done to password_change_done.

  • Related