Registry / web-framework / django-tailwind

django-tailwind

JSON →
library4.5.0pypypiunverified

The django-tailwind library integrates the Tailwind CSS framework seamlessly into Django projects. It provides management commands to install, build, and serve Tailwind CSS, streamlining frontend development within a Django context. It is actively maintained with frequent releases, currently at version 4.4.2.

pip install django-tailwind
INSTALL
IMPORT
SIG · DJANGO-TAILWIND
D
django-tailwind
web-frameworkpythonv4.5.0
Install
3.5s avg
Import
—
Disk
66MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v4.2.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 66.5MB
glibc
py 3.10–3.920 runs
installs and imports cleanly · install 3.5s · import 0.000s · 67MB
66MB installed
● package 66MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

django_tailwind
✓ INSTALLED_APPS = ['django_tailwind', ...]
Required in settings.py for management commands and template tags.
TAILWIND_APP_NAME
✓ TAILWIND_APP_NAME = 'theme'
Required in settings.py to specify the Django app hosting Tailwind's static files.
tailwind_tags
✓ {% load tailwind_tags %}
Required in Django templates to use Tailwind's template tags.
tailwind_css
✓ {% tailwind_css %}
Required in Django templates (typically base.html) to link the generated Tailwind CSS.

To quickly get started, add `django_tailwind` and your designated Tailwind app (e.g., 'theme') to `INSTALLED_APPS`, define `TAILWIND_APP_NAME`, include `django_tailwind.urls` in your project's `urls.py`, and use `{% tailwind_css %}` in your base template. Then, run `python manage.py tailwind install` to set up Node.js dependencies and `python manage.py tailwind start` for development.

# settings.py INSTALLED_APPS = [ # ... your other apps 'django_tailwind', 'theme', # Your Tailwind app name ] TAILWIND_APP_NAME = 'theme' # urls.py (your project's main urls.py) from django.contrib import admin from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), path('', include('django_tailwind.urls')), # ... your other url patterns ] # Your Tailwind app (e.g., 'theme/apps.py') # Make sure to define your Tailwind app as a Django app # For example: # from django.apps import AppConfig # class ThemeConfig(AppConfig): # default_auto_field = 'django.db.models.BigAutoField' # name = 'theme' # In your base template (e.g., templates/base.html) # Make sure to create a templates directory in your 'theme' app # and an input.css in 'theme/static_src/input.css' # {% load tailwind_tags %} # <head> # <title>My Django Tailwind App</title> # {% tailwind_css %} # </head> # <body> # <h1 class="text-3xl font-bold underline">Hello Tailwind!</h1> # </body> # Terminal commands # python manage.py tailwind install # python manage.py tailwind start # (Open browser to your Django app, check console for Tailwind CSS build output)
django-admin --version
Debug
Known issues
breakingVersion 4.0 introduced several breaking changes including renaming `TAILWIND_CSS_PATH` to `TAILWIND_INPUT_CSS_PATH`, removing `TAILWIND_POSTCSS_OPTIONS` and `TAILWIND_NPM_PATH`, and requiring `TAILWIND_APP_NAME` to be set before `tailwind install`.
fix
Review your `settings.py` for renamed variables. Ensure `TAILWIND_APP_NAME` is configured before running `python manage.py tailwind install`.
affects: 4.0.0 and above
gotchadjango-tailwind requires Node.js and npm to be installed on your system for the Tailwind CLI to function correctly. These are not Python dependencies and must be installed separately.
fix
Install Node.js and npm for your operating system. Verify installation by running `node -v` and `npm -v` in your terminal.
affects: All versions
gotchaThe `TAILWIND_APP_NAME` setting must be defined in your `settings.py` BEFORE running `python manage.py tailwind install`. Failure to do so can lead to an incomplete setup or errors during installation.
fix
Ensure `TAILWIND_APP_NAME = 'your_app_name'` is correctly configured in `settings.py` and that `your_app_name` is also in `INSTALLED_APPS` before executing `python manage.py tailwind install`.
affects: All versions
gotchaThere's a distinction between `python manage.py tailwind start` (for development with hot-reloading) and `python manage.py tailwind build` (for production static file generation). Using `start` in production will not generate optimized static assets.
fix
Use `python manage.py tailwind start` during development. For production deployment, ensure you run `python manage.py tailwind build` to compile your CSS, followed by `python manage.py collectstatic` to gather the output.
affects: All versions
Upgrade
Version history
4.5.0latest on PyPI · released Jun 12, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
12
Resources
django-tailwind — pip install django-tailwind · libregistry