Anirudh Srivastava
Anirudh Srivastava

Reputation: 31

Can we create django forms without Crispy Forms Template?

I am a front-end developer, hardly 2 weeks old with Django with basic structured knowledge of Python. Since I am always keen to develop my own designs and layouts, I am not a great fan of using Bootstrap. I have seen and followed multiples tutorials and everyone is focussing at including Bootstrap while creating log-in forms crispy forms.

I would like to know if there is any possible way to style forms by using customised CSS and not including Bootstrap and how to do that.

Please help. Looking forward.

Upvotes: 1

Views: 593

Answers (1)

CYW
CYW

Reputation: 135

Sure instead of just adding your form like this {% form %}

just loop through the form fields and add your own classes.

{% for field in form %}
    <label class="my-custom-style" for="{{ field.auto_id }}">{{ field.label }}</label>
    {{ field }}
{% endfor %}

then add your custom static css file.

Hope it helped!

Upvotes: 2

Related Questions