Skip to main content

django-tailwind-cli

GitHub Workflow Status PyPI Ruff uv GitHub Django Versions Python Versions Downloads Downloads / Month

Tailwind CSS for Django without Node.js. The library downloads the standalone Tailwind CSS CLI and wires it into Django management commands, so there is no npm, no webpack, and no separate build tool to configure. It follows the approach of the Tailwind integration for Phoenix.

What it does

  • Downloads and manages the Tailwind CLI binary for your platform
  • Rebuilds CSS on change, running under Django's own auto-reloader
  • Produces minified production builds containing only the classes you use
  • Includes the CSS via a {% tailwind_css %} template tag
  • Supports DaisyUI through tailwindcss-cli-extra
  • Targets Tailwind CSS 4.x

Quickstart

In an existing Django project, install the package:

python -m pip install django-tailwind-cli

Add the app and a static files directory to settings.py:

INSTALLED_APPS = [
    # ... your other apps
    "django_tailwind_cli",
]

STATICFILES_DIRS = [BASE_DIR / "assets"]

Create that directory before starting Django:

mkdir -p assets

Load the template tag in your base template and place it inside <head>:

{% load tailwind_cli %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>My Django App</title>
    {% tailwind_css %}
</head>
<body>
    {% block content %}{% endblock %}
</body>
</html>

Start Django and the Tailwind watcher together:

python manage.py tailwind runserver

The first run downloads the CLI and creates the default source CSS. Add Tailwind classes to your templates; the watcher rebuilds the stylesheet when you save them.

For a production build, run Tailwind before collecting static files:

python manage.py tailwind build
python manage.py collectstatic --noinput

See the installation guide for setup checks and optional integrations, and the workflow guide for custom CSS, editor setup and troubleshooting.

Requirements

  • Python: 3.10+
  • Django: 4.2 LTS, 5.2, 6.0, or 6.1
  • Platform: Windows, macOS, Linux (automatic platform detection)

Configuration and commands

The defaults work with the setup above. Optional settings let you pin the Tailwind version, use a system binary, add custom CSS, enable DaisyUI, or include editable-installed external apps. See the settings reference.

The command reference covers all commands and options. To inspect your setup or investigate a build problem, start with:

python manage.py tailwind config
python manage.py tailwind build --verbose
python manage.py tailwind troubleshoot

Contributing

Contributions are welcome. CONTRIBUTING.md covers the development setup (mise provisions Python, uv, and pre-commit), how to run the tests, and what a pull request should look like. Please read the short section at the top of it before opening an issue or a pull request — it explains what makes one easy to act on.

License

This software is licensed under MIT license.

Metadata

Release files for django-tailwind-cli 4.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-tailwind-cli 4.8.1
File Size Uploaded
django_tailwind_cli-4.8.1.tar.gz 165.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-tailwind-cli 4.8.1
File Interpreter ABI Platform
django_tailwind_cli-4.8.1-py3-none-any.whl Python 3 none any Details

Total release size: 215.8 kB

Release files / django_tailwind_cli-4.8.1.tar.gz

Download URL django_tailwind_cli-4.8.1.tar.gz
Size 165.2 kB
Tags Source
SHA-256 checksum
How to use checksums
25f6362d64c19dd363d6a720eaf8cbfc1b05699190e9f73fb7c378138bc7675b
BLAKE2b-256 checksum
How to use checksums
b83331713a0ffcdf9ebda53787bb5da44d8e741b80a200ccc55ee7f193221640
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.

Transparency log

Release files / django_tailwind_cli-4.8.1-py3-none-any.whl

Download URL django_tailwind_cli-4.8.1-py3-none-any.whl
Size 50.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
804268c985729582c4e633b176178b5aad104bcc1507fcaac8e6002f031b93ac
BLAKE2b-256 checksum
How to use checksums
a261f8317c8dcdc7f25741c7dfd81d1f376f4f29d587ae1d5cb97980fc4946cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

4.8.1 This release

2 release files

4.8.0

2 release files

4.7.0

2 release files

4.6.2

2 release files

4.6.1

2 release files

4.6.0

2 release files

4.5.1

2 release files

4.5.0

2 release files

4.4.2

2 release files

4.4.1

2 release files

4.4.0

2 release files

4.3.0

2 release files

4.2.4

2 release files

4.2.3

2 release files

4.2.2

2 release files

4.2.1

2 release files

4.1.0

2 release files

4.0.1

2 release files

4.0.0

2 release files

2.22.1

2 release files

2.20.2

2 release files

2.20.1

2 release files

2.20.0

2 release files

2.19.3

2 release files

2.19.2

2 release files

2.19.1

2 release files

2.19.0

2 release files

2.16.0

2 release files

2.12.0

2 release files

2.11.0

2 release files

2.10.0

2 release files

2.9.0

2 release files

2.8.1

2 release files

2.8.0

2 release files

2.7.3

2 release files

2.7.2

2 release files

2.7.0

2 release files

2.6.0

2 release files

2.4.5

2 release files

2.4.4

2 release files

2.4.3

2 release files

2.4.2

2 release files

2.4.1

2 release files

2.4.0

2 release files

2.3.0

2 release files

2.2.3

2 release files

2.2.2

2 release files

2.2.0

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.6

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.2

2 release files

2.0.1

2 release files

1.4.3

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page