skillfed

django-crispy-forms

Best way to have Django DRY forms

django-crispy-forms v2.7 3.3M downloads/30d#2,667 on PyPI5,160
Permissive license MIT Active released

What it is and what it does

django-crispy-forms is a Django application that lets you build form layouts programmatically instead of writing HTML in templates. It provides a filter and template tag that render forms with full control over the output HTML while keeping your code DRY and maintainable. The package abstracts form rendering into reusable layout components, so you define form structure in Python rather than templates.

It integrates with multiple CSS frameworks—Bootstrap (versions 2, 3, and 4), Tailwind, Bulma, and Foundation—and lets you switch between them using a Django setting. You can also create custom template packs for your own framework. The package respects Django's standard form API, so it works alongside other form libraries without conflicts.

Use it for:

  • Render Django forms with Bootstrap styling without manually writing HTML in templates.
  • Build reusable form layout components that can be shared across multiple views and templates.
  • Switch CSS frameworks by changing a single Django setting without modifying form code.
  • Create custom form layouts with programmatic control over field grouping, ordering, and HTML attributes.
  • Maintain DRY form code when working on projects with complex or repetitive form structures.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Renders Django forms programmatically with full HTML control using reusable layout components, supporting multiple CSS frameworks without writing templates.

Yes. django-crispy-forms is actively maintained, has no known vulnerabilities, low install friction, and a permissive MIT license. It solves a real Django problem—form rendering without template boilerplate—and is widely used (top 5000 PyPI packages). Install it if you're building Django forms and want to avoid writing HTML templates.

Install

django-crispy-forms on PyPI

pip

pip install django-crispy-forms

uv

uv add django-crispy-forms

poetry

poetry add django-crispy-forms

Installing django-crispy-forms

Before you install

Low install friction with a single dependency on django. Active maintenance—last commit 2026-07-29, released 16 days ago, with 5160 repository stars. Supports current Python versions (3.10+) and recent Django releases (5.2, 6.0, 6.1).

License in practice

MIT license (permissive) allows commercial and private use with minimal restrictions—suitable for most projects without legal concern.

Quickstart

pip install django-crispy-forms

from django import forms

class MyForm(forms.Form):
    name = forms.CharField()

# In template: {{ form|crispy }} or {% crispy form %}

Requires Django 5.2+ and Python 3.10+; a frontend template pack must be installed separately for CSS framework support.

Verify before relying

  • Whether the package is actively maintained beyond the recent release date or if activity is sporadic.
  • Performance characteristics when rendering large forms or complex nested layouts.
  • Compatibility details with custom or less common CSS frameworks beyond those mentioned.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 1 — django
Maintenance actively maintained — 16 days since the last release
Last repo commit
First released
Downloads 3,298,894/month — #2,667 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: django_crispy_forms-2.7-py3-none-any.whl

Keywords: forms, django, crispy, DRY

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 5.2Framework :: Django :: 6.0Framework :: Django :: 6.1Operating System :: OS IndependentProgramming Language :: JavaScriptProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Internet :: WWW/HTTPTopic :: Internet :: WWW/HTTP :: Dynamic ContentTopic :: Software Development :: Libraries :: Python Modules

Tags

django form renderingcrispy forms layoutdjango DRY formsbootstrap form templatesdjango form stylingreusable form componentsdjango form HTML control
django-formstemplate-renderingcss-framework-agnostic

More Python Modules packages