Django Crispy Forms

Django crispy forms help in rending a prettier-looking form element without working on the HTML or CSS elements. If you use the ModelForm concept in Django, Crispy forms are the easiest way to render a clean form element.

This tutorial explains all aspects of using a Django Crispy Form in your web application step-by-step.

Step 1: Install Django Crispy Forms

pip install django-crispy-forms

Add crispy_forms in your file under the list of INSTALLED_APPS


Step 2: Select Template Pack for Django Crispy Forms

Django Crispy Forms have built-in support for CSS frameworks like bootstrap, bootstrap3, bootstrap4, foundation, uni-form, and tailwind. To select a template pack add the below code in :


You may use other CSS frameworks like bootstrap or foundation.

Step 3: Apply crispy tag to your form element

In order to apply the crispy tag to your ModelForm object use the code below

{% load crispy_forms_tags % }

<form method="post" class="uniForm">
    {{ form|crispy } }

You may use other CSS classes like bootstrap or foundation.

That's it. You are set. Your form element will now look crispy.