Zero-config Tailwind CSS v4 for Django. Auto-downloads the standalone CLI, discovers your templates, and watches for changes when you run runserver.
No Node.js. No config files. No build step to remember.
pip install django-twAdd it to the top of INSTALLED_APPS:
INSTALLED_APPS = [
"django_wind",
# ...
]Add the template tag to your base template:
{% load wind %}
{% wind_css %}Start your dev server as usual:
python manage.py runserverTailwind starts automatically in watch mode. Edit your templates, the CSS rebuilds.
For production:
python manage.py tailwind build- Downloads the Tailwind v4 standalone CLI on first run (cached at
~/.django-wind/bin/) - Scans
TEMPLATESandINSTALLED_APPSto find all template directories - Generates an input CSS file with
@sourcedirectives pointing to your templates - Outputs to
static/css/wind.css
All optional. Add a WIND dict to your Django settings:
WIND = {
"OUTPUT_CSS": "css/wind.css", # path relative to STATICFILES_DIRS[0]
"CLI_VERSION": "v4.2.2", # pin a version (default: "latest")
"CLI_PATH": "/usr/local/bin/tw", # use a pre-installed binary
"EXTRA_SOURCES": [ # additional source globs
"/path/to/extra/templates/**/*.html",
],
}MIT