How to add a class to django form label?
I have <label for="id_first_name">First name:</label> when I use {{ form.first_name.label_tag }}
I want to add class="col-sm-4 control-label" with label.How can I do that?
You can use form init method to call class
class YourForm(forms.Form)
def __init__(self, *args, **kwargs):
super(YourForm, self).__init__(*args, **kwargs)
self.fields['field_name'].widget.attrs['class'] = 'your_class'