crispy-tailwind provides a Tailwind CSS template pack for Django Crispy Forms, allowing developers to easily render forms with Tailwind's utility-first classes. It is currently at version 1.0.3 and has a moderately active release cadence, with frequent bug-fix releases and major versions adding support for newer Django and Python versions.
pip install crispy-tailwindVerified import paths — ran on the pinned version, not inferred.
After installing, add 'crispy_forms' and 'crispy_tailwind' to your `INSTALLED_APPS` in `settings.py`. Crucially, set `CRISPY_ALLOWED_TEMPLATE_PACKS = "tailwind"` and `CRISPY_TEMPLATE_PACK = "tailwind"`. Then, in your Django forms, instantiate a `FormHelper` and define your layout. Finally, render the form in your template using `{% load crispy_forms_tags %}` and `{% crispy form %}`.
Upgrade your Django project to Django >=4.2 and Python >=3.8. Also, ensure `django-crispy-forms` is at least version 2.0.0. Review the release notes for `crispy-tailwind 1.0.0` for full details.
Ensure `INSTALLED_APPS` in `settings.py` is configured as: `['crispy_forms', 'crispy_tailwind', ...]`. The order matters for template loading.
Refer to the official Tailwind CSS documentation and your Django project's setup guide to correctly integrate and build Tailwind CSS (e.g., via PostCSS, CDN, or Tailwind CLI) for your frontend.
In your `settings.py`, ensure you have both `CRISPY_ALLOWED_TEMPLATE_PACKS = "tailwind"` and `CRISPY_TEMPLATE_PACK = "tailwind"` defined.
Add `CRISPY_ALLOWED_TEMPLATE_PACKS = "tailwind"` to `settings.py`. Also, ensure `crispy_tailwind` is included in `INSTALLED_APPS` (after `crispy_forms`).
Verify that both `crispy_forms` and `crispy_tailwind` are in your `INSTALLED_APPS` in `settings.py` (in that order), and that `CRISPY_TEMPLATE_PACK = "tailwind"` is correctly set.
Ensure `CRISPY_TEMPLATE_PACK = "tailwind"` is set in `settings.py`. Crucially, confirm that Tailwind CSS is properly built, included, and available in your frontend assets for your Django templates.
Add `from crispy_forms.helper import FormHelper` to the top of your `forms.py` file where `FormHelper` is used.