I made a custom user form with fields username, password1 and pasword2, based on UserCreationForm.
I want to style it using bootstrap form-control in Meta widgets, but it doesn't work.
Is this possible?
EDIT
Although password1 and password2 are not in Meta fields, they are rendered.
The code:
class UserForm(UserCreationForm):
class Meta:
model = User
fields = ['username']
widgets = {
'username': TextInput(attrs = {
'class': 'form-control',
}),
'password1': PasswordInput(attrs = {
'class': 'form-control',
}),
'password2': PasswordInput(attrs = {
'class': 'form-control',
}),
}