我想允许用户更改密码,我正在使用 django-in-built password_change 函数。我想使用默认的模板名称和密码更改表单,但我想将 post_change_redirect 参数更改为特定于我的网站。
我如何在保持其余部分不变的情况下更改它?
来自 Django 文档:
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:密码更改表单(参见上面的 password_change_form)。
需要一些指导。谢谢。