django-crispy-forms renders Django forms with a |crispy filter and {% crispy %} tag, using helpers and layouts instead of hand-written HTML templates.
Overview
django-crispy-forms gives Django projects a structured way to render forms as div-based layouts while controlling HTML output from Python. It stays compatible with Django’s normal form APIs and other form-related apps.
The |crispy filter offers a quick path similar to as_table or as_p, while the {% crispy %} tag renders forms from a FormHelper and explicit layout objects for finer control. Layout building blocks include rows, columns, fieldsets, buttons, and framework-specific components.
Template packs adapt output to several front-end frameworks, including Twitter Bootstrap versions 2–4, Tailwind, Bulma, and Foundation, selectable via CRISPY_TEMPLATE_PACK. Teams can also define custom template packs. Documentation covers helpers, layouts, formsets, AJAX validation patterns, and overriding templates.
The project evolved from django-uni-form and supports current Django releases with a separate package for Bootstrap 5. It emphasizes DRY form markup and reusable layout composition in views and templates.
Key features
- |crispy filter for quick rendering
- {% crispy %} tag with FormHelper
- Composable layout objects
- Multiple frontend template packs
- Bootstrap, Tailwind, Bulma, Foundation
- Formset and inline layout support
- Custom template pack authoring
- Helper attributes per framework
Use cases
- Bootstrap-styled Django forms
- Reusable form layouts across views
- Complex multi-field form composition
- Reducing bespoke form HTML templates