maybe it is just a bug or well known feature, but didn't found anything with google.
Snippet from a form(RegisterForm for django-registration):
widgets = {
'username': HiddenInput(),
'email': EmailInput(attrs={'class': "form-control"}),
'password1': PasswordInput(attrs={'class': "form-control"}),
'password2': PasswordInput(attrs={'class': "form-control"}),
'first_name': TextInput(attrs={'class': "form-control"}),
'last_name': TextInput(attrs={'class': "form-control"}),
}
Snippet from template:
<div class="container">
{{ form.non_field_errors }}
<form method="post">
{% csrf_token %}
{% for field in form %}
{% if field.name != 'username' %}
<div class="form-group row {% if field.errors %}has-danger{% endif %}">
{% if field.errors %}
<div class="form-control-feedback">{{ field.errors.as_text }}</div>
{% endif %}
<label for="{{ field.id_for_label }}" class="col-form-label col-xs-2">{{ field.label }}</label>
<div class="col-sm-10">
{{ field }}
</div>
</div>
{% endif %}
{% endfor %}
<div class="form-group row">
<div class="offset-sm-2 col-sm-10">
<button type="submit" class="btn btn-primary">Register</button>
</div>
</div>
</form>
No rocket science at all. Passwords and email do not get the css class, but textfields! Am i missing something?