我试图重写SetPasswordForm以添加占位符和类,但似乎无法正常工作。我设法做到了登录页和密码重置页,但在这里我卡住了。在
class MySetPasswordForm(SetPasswordForm):
new_password1 = forms.CharField(
label=_("New password"),
widget=forms.PasswordInput(attrs={'placeholder': 'New Password', 'class': 'password1'}),
strip=False,
help_text=password_validation.password_validators_help_text_html(),
)
new_password2 = forms.CharField(
label=_("New password confirmation"),
strip=False,
widget=forms.PasswordInput(attrs={'placeholder': 'Repeat Password', 'class': 'password2'}),
)
^{pr2}$
这个准确吗?在
您在URL模式中使用了错误的路径。它应该是:
相关问题 更多 >
编程相关推荐