I would like to allow the user to change the password and I am using the django-in-built password_change function. I would like to use the default template-name and password_change_form but I want to change the post_change_redirect argument to specific to my website.
How do I change that only while keeping the rest the same?
From Django Documentation:
password_change(request[, template_name, post_change_redirect, password_change_form])
Allows a user to change their password.
URL name: password_change
Optional arguments:
template_name: The full name of a template to use for displaying the password change form. Defaults to registration/password_change_form.html if not supplied.
post_change_redirect: The URL to redirect to after a successful password change.
password_change_form: A custom "change password" form which must accept a user keyword argument. The form is responsible for actually changing the user's password. Defaults to PasswordChangeForm.
Template context:
form: The password change form (see password_change_form above).
Need some guidance. Thanks.
You want to define a view, which will be serving a modified
password_changeview:And that’s all.
You must only remember that, it’ll redirect you to the default login-page if you’re not logged-in and that you have to write a password change page template (named
registration/password_change_form.htmlby default)