customize the way usercreationform looks in django

django, django-forms

Solution

You need to create your form from sctratch, it should not extend the UserCreationForm. The UserCreationForm have a username field explicitly defined in it as well as some other fields. You can look at it here.

Problem

I want to customize the UserCreationForm from django. I do the following ``` class myUserCreationForm(UserCreationForm): class Meta: model=User fields = ('username', 'password1', 'password2') widgets = { 'username':TextInput(attrs={'class':'form-control'}), 'password':TextInput(attrs={'class':'form-control'}), 'password2':TextInput(attrs={'class':'form-control'}), } ``` but its not working. When the template is rendered It creates the input boxes don't have the form-control class attached to them. What could be wrong?

Original source

Related problems