1
我想允许用户更改密码,并且我正在使用django-in-built password_change函数。我想使用默认的模板名称和password_change_form,但我想将post_change_redirect参数更改为特定于我的网站。Django用户认证中的password_change函数
只有在保持其余部分不变的情况下,我该如何改变它?
从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:
形式:密码变化形式(见password_change_form上文)。
需要一些指导。谢谢。
' password_change(request,post_change_redirect ='my_url')'? –
def lmlogout(请求): “”“ 注销视图 ”“” 返回password_change(request,post_change_redirect ='my_url')正确的用法? – lakesh
最好在Django中尝试它,但这就是我将如何使用该功能。 –