【发布时间】:2020-04-09 13:27:16
【问题描述】:
用户可以在我的更改密码页面上更改他们的密码:
<form class="password-change-form" method="POST">
{% csrf_token %}
<div>
{{ form }}
</div>
<input class="submit-button" type="submit" value="Change password">
</form>
我的 urls.py:
path(
'accounts/password_change/',
auth_views.PasswordChangeView.as_view(template_name='account/password_change_form.html'),
name='password_change'
),
问题
PasswordChangeView 默认uses PasswordChangeForm。
我想在此表单中添加占位符文本,即旧密码占位符文本:“输入您的旧密码”。
我怎样才能最好地做到这一点?
【问题讨论】:
标签: python django python-3.x django-forms django-views