Metadata-Version: 2.5
Name: django-tailwind
Version: 4.6.0
Summary: Tailwind CSS Framework for Django projects
Project-URL: Changelog, https://github.com/timonweb/django-tailwind/blob/master/CHANGELOG.md
Project-URL: Documentation, https://django-tailwind.readthedocs.io/
Project-URL: Homepage, https://github.com/timonweb/django-tailwind
Project-URL: Issues, https://github.com/timonweb/django-tailwind/issues
Author-email: Tim Kamanin <tim@timonweb.com>
License-Expression: MIT
License-File: LICENSE
Keywords: css,django,tailwind
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 5.2
Classifier: Framework :: Django :: 6.0
Classifier: Framework :: Django :: 6.1
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Utilities
Requires-Python: >=3.11
Requires-Dist: django>=5.2
Requires-Dist: pytailwindcss>=0.3.1
Provides-Extra: cookiecutter
Requires-Dist: cookiecutter<3,>=2.7.1; extra == 'cookiecutter'
Provides-Extra: honcho
Requires-Dist: honcho<3,>=2.0.0; extra == 'honcho'
Provides-Extra: reload
Requires-Dist: django-browser-reload<2,>=1.21.0; extra == 'reload'
Description-Content-Type: text/markdown

# Tailwind CSS integration for Django a.k.a. Django + Tailwind = 💚

![Tests](https://github.com/timonweb/django-tailwind/actions/workflows/ci.yml/badge.svg)
[![PyPI](https://img.shields.io/pypi/v/django-tailwind.svg?style=flat-square)](https://pypi.org/project/django-tailwind/)
![GitHub](https://img.shields.io/github/license/timonweb/django-tailwind?style=flat-square)
![Python versions](https://img.shields.io/pypi/pyversions/django-tailwind)
[![Downloads](https://static.pepy.tech/badge/django-tailwind)](https://pepy.tech/project/django-tailwind)
[![Downloads / Month](https://pepy.tech/badge/django-tailwind/month)](<https://pepy.tech/project/django-tailwind>)

![Django Tailwind Demo](https://raw.githubusercontent.com/timonweb/django-tailwind/master/docs/django-tailwind-demo-800.gif)

## Goal

This project provides a convenient way to integrate the *Tailwind CSS* framework into a Django project.
It creates a new Django app (named theme by default) that includes all the necessary files and configurations to get
started with *Tailwind CSS* quickly and **without even needing to install `Node.js`** if you choose the standalone binary mode.

## Features

* An opinionated *Tailwind CSS* setup that makes your life easier;
* **Two installation modes:** standalone binary (works without `Node.js`) or npm-based (`Node.js` required);
* Hot reloading of CSS, configuration files, and *Django* templates. No more manual page refreshes!
* Out of the box support for CSS imports and nesting;
* Supports the latest *Tailwind CSS* `v4.x`;
* Start both *Tailwind CSS* and *Django* development servers with a single command;
* An optional DaisyUI integration to spice up your Tailwind templates with pre-built components.
* A convenient management command for installing Tailwind CSS plugins;

## Requirements

Python 3.11 or newer and Django 5.2 or newer.

**Note:** `Node.js` 22 or newer is only required if you choose the npm-based installation. The standalone binary mode does not require Node.js.

## Documentation

The full documentation is at https://django-tailwind.readthedocs.io/ or in the [docs directory](docs/index.md) of this
repository.

## Install with an AI agent

Using a coding agent such as Claude Code, Codex, or Cursor? Point it at [`llms.txt`](https://github.com/timonweb/django-tailwind/blob/master/llms.txt) and let it do the setup:

```text
Install and configure django-tailwind in this project by following
https://raw.githubusercontent.com/timonweb/django-tailwind/master/llms.txt
```

The agent will ask you a few questions (standalone or npm-based, app name, daisyUI) and then install, configure, and verify everything.

## Getting Started

1. **Install django-tailwind:**

   a) With all dependencies that make development easier (recommended):
    ```bash
   pip install 'django-tailwind[cookiecutter,honcho,reload]'
   ```

   b) or just the core package (enough for production use; `tailwind init` additionally needs the `cookiecutter` extra):
    ```bash
    pip install django-tailwind
    ```

2. **Add to INSTALLED_APPS in settings.py:**
   ```python
   INSTALLED_APPS = [
       # ...
       "tailwind",
   ]
   ```

3. **Create Tailwind app:**
   ```bash
   python manage.py tailwind init
   ```

4. **Add the generated app to INSTALLED_APPS and configure:**
   ```python
   INSTALLED_APPS = [
       # ...
       "tailwind",
       "theme",  # your generated app name
   ]

   TAILWIND_APP_NAME = "theme"
   ```

5. **Install Tailwind CSS dependencies:**
   ```bash
   python manage.py tailwind install
   ```

6. **Start development (runs Django + Tailwind):**
   ```bash
   python manage.py tailwind dev
   ```

7. **Use Tailwind classes in your templates:**
   ```html
   {% load tailwind_tags %}
   {% tailwind_css %}

   <h1 class="text-4xl font-bold text-blue-600">Hello Tailwind!</h1>
   ```

That's it! 🎉 Your Django project now has Tailwind CSS installed and ready to use.

For configuring automatic page reloads during development, see the [Installation](docs/installation.md) instructions.

## Bugs and suggestions

Please see [CONTRIBUTING](CONTRIBUTING.md).

2019 - 2026 (c) Tim Kamanin — [A Full-Stack Django and Wagtail Developer](https://timonweb.com)

## Star History

[![Star History Chart](https://api.star-history.com/svg?repos=timonweb/django-tailwind&type=date&legend=top-left)](https://www.star-history.com/#timonweb/django-tailwind&type=date&legend=top-left)
