Answer the question
In order to leave comments, you need to log in
How to attach styles in a template to fields from a Django model?
There is such a form for registration, where form is the form of the model from django
<form action="" method="post">
{% csrf_token %}
{{ form.as_p }}
<div>
<input type="submit" class="btn" value="submit">
</div>
</form>
как указать классы для этих полей, чтобы применить bootstrap стили
Answer the question
In order to leave comments, you need to log in
class SomeForm(forms.Form):
some_field = forms.CharField(widget=forms.TextInput(attrs={'class': 'form-control'}))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question