I wanted to create a form for resetting the user’s password. It should take the current_password, and then the new_password and confirm_new_password. I’m able to do the validation to check the new passwords are matching. How would I be able to validate the current_password? Is there a way to pass in the User object into the form?
I wanted to create a form for resetting the user’s password. It should take
Share
Django comes with a built in
PasswordChangeFormthat you can import and use in your view.But you don’t even have to write your own password reset view. There is a pair of views
django.contrib.with.views.password_changeanddjango.contrib.auth.views.password_change_done, that you can hook straight into your URL config.