I have the following form in my forms.py
. For some reason the override of label and help_text for username
field WORKS and (both) the password fields doesn't.
class CreateUserForm(UserCreationForm):
class Meta:
model = User
fields = ['username', 'password1', 'password2']
labels = {
'username': 'My Username Label',
'password1': 'My Password1 Label',
'password2': 'My Password2 Label',
}
help_texts = {
'username': 'My username help_text',
'password1': 'My password1 help_text',
}
When rendered the default django label/help_texts are showed for password fields:
Your password can’t be too similar to your other personal information.
Your password must contain at least 8 characters.
...
I've already read those answers, but they weren't helpful: Q1 Q2 Q3
I've also read the docs, and there is a note here (green note lowering the page) that seems to be related, but I don't really understand it. It mentions Fields defined declaratively, which I'm not doing. Also wouldn't explain why it works for username
and not for password1
.