{"id":18038847,"url":"https://github.com/django-commons/django-tailwind-cli","last_synced_at":"2026-05-10T21:57:55.200Z","repository":{"id":61936980,"uuid":"556335248","full_name":"django-commons/django-tailwind-cli","owner":"django-commons","description":"Django and Tailwind integration based on the prebuilt Tailwind CSS CLI.","archived":false,"fork":false,"pushed_at":"2026-05-10T19:26:44.000Z","size":1717,"stargazers_count":203,"open_issues_count":1,"forks_count":24,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-05-10T21:25:33.266Z","etag":null,"topics":["django","django-application","python","tailwind","tailwind-css","tailwindcss"],"latest_commit_sha":null,"homepage":"https://django-tailwind-cli.rtfd.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/django-commons.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-10-23T16:09:40.000Z","updated_at":"2026-05-10T19:24:51.000Z","dependencies_parsed_at":"2026-04-08T14:02:30.338Z","dependency_job_id":null,"html_url":"https://github.com/django-commons/django-tailwind-cli","commit_stats":{"total_commits":328,"total_committers":11,"mean_commits":"29.818181818181817","dds":"0.28658536585365857","last_synced_commit":"5f48f8c92c3612acfb34386eb83fe9348cf038eb"},"previous_names":["django-commons/django-tailwind-cli","oliverandrich/django-tailwind-cli"],"tags_count":82,"template":false,"template_full_name":null,"purl":"pkg:github/django-commons/django-tailwind-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/django-commons%2Fdjango-tailwind-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/django-commons%2Fdjango-tailwind-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/django-commons%2Fdjango-tailwind-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/django-commons%2Fdjango-tailwind-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/django-commons","download_url":"https://codeload.github.com/django-commons/django-tailwind-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/django-commons%2Fdjango-tailwind-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32873150,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"ssl_error","status_checked_at":"2026-05-10T13:40:02.145Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","django-application","python","tailwind","tailwind-css","tailwindcss"],"created_at":"2024-10-30T14:06:38.138Z","updated_at":"2026-05-10T21:57:55.194Z","avatar_url":"https://github.com/django-commons.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# django-tailwind-cli\n\n\u003cp style=\"display: flex; gap: 4px; flex-wrap: wrap; align-items: flex-start; line-height: 1;\"\u003e\n\u003cimg style=\"height: auto;\" alt=\"GitHub Workflow Status\" src=\"https://img.shields.io/github/actions/workflow/status/django-commons/django-tailwind-cli/test.yml\"\u003e\n\u003ca style=\"display: inline-block;\" href=\"https://pypi.org/project/django-tailwind-cli/\"\u003e\u003cimg style=\"height: auto;\" alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/django-tailwind-cli.svg\"\u003e\u003c/a\u003e\n\u003ca style=\"display: inline-block;\" href=\"https://github.com/astral-sh/ruff\"\u003e\u003cimg style=\"height: auto;\" alt=\"Ruff\" src=\"https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json\"\u003e\u003c/a\u003e\n\u003ca style=\"display: inline-block;\" href=\"https://github.com/astral-sh/uv\"\u003e\u003cimg style=\"height: auto;\" alt=\"uv\" src=\"https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json\"\u003e\u003c/a\u003e\n\u003cimg style=\"height: auto;\" alt=\"GitHub\" src=\"https://img.shields.io/github/license/django-commons/django-tailwind-cli\"\u003e\n\u003cimg style=\"height: auto;\" alt=\"Django Versions\" src=\"https://img.shields.io/pypi/frameworkversions/django/django-tailwind-cli\"\u003e\n\u003cimg style=\"height: auto;\" alt=\"Python Versions\" src=\"https://img.shields.io/pypi/pyversions/django-tailwind-cli\"\u003e\n\u003ca style=\"display: inline-block;\" href=\"https://pepy.tech/project/django-tailwind-cli\"\u003e\u003cimg style=\"height: auto;\" alt=\"Downloads\" src=\"https://static.pepy.tech/badge/django-tailwind-cli\"\u003e\u003c/a\u003e\n\u003ca style=\"display: inline-block;\" href=\"https://pepy.tech/project/django-tailwind-cli\"\u003e\u003cimg style=\"height: auto;\" alt=\"Downloads / Month\" src=\"https://pepy.tech/badge/django-tailwind-cli/month\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n**The simplest way to integrate Tailwind CSS with Django** ⚡\n\nNo Node.js required! This library provides seamless [Tailwind CSS](https://tailwindcss.com) integration for Django using the standalone [Tailwind CSS CLI](https://tailwindcss.com/blog/standalone-cli). Inspired by the [Tailwind integration for Phoenix](https://github.com/phoenixframework/tailwind), it eliminates the need for Node.js in your Django development workflow.\n\n## ✨ Why django-tailwind-cli?\n\n- **🚀 Zero Node.js dependency** - No npm, webpack, or build tools required\n- **⚡ Instant setup** - Get Tailwind running in under 5 minutes\n- **🔄 Hot reload** - Watch mode with automatic CSS rebuilding\n- **📦 Production ready** - Optimized builds with automatic purging\n- **🎨 DaisyUI support** - Built-in component library integration\n- **🛠️ Developer friendly** - Rich CLI with helpful error messages and debugging tools\n\n## 🚀 Quick Start\n\n### 1. Install the package\n\n```bash\n# Using pip\npip install django-tailwind-cli\n\n# Using uv (recommended)\nuv add django-tailwind-cli\n\n# Using poetry\npoetry add django-tailwind-cli\n```\n\n### 2. Configure Django settings\n\nAdd to your `settings.py`:\n\n```python\nINSTALLED_APPS = [\n    # ... your other apps\n    \"django_tailwind_cli\",\n]\n\n# Configure static files directory — make sure it exists on disk,\n# Django raises an error at startup if it does not.\nSTATICFILES_DIRS = [BASE_DIR / \"assets\"]\n```\n\n```bash\nmkdir -p assets\n```\n\n### 3. Set up your base template\n\nCreate or update your base template (e.g., `templates/base.html`):\n\n```html\n\u003c!DOCTYPE html\u003e\n{% load tailwind_cli %}\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n    \u003cmeta charset=\"UTF-8\"\u003e\n    \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n    \u003ctitle\u003eMy Django App\u003c/title\u003e\n    {% tailwind_css %}\n\u003c/head\u003e\n\u003cbody class=\"bg-gray-50\"\u003e\n    \u003cdiv class=\"container mx-auto px-4\"\u003e\n        {% block content %}{% endblock %}\n    \u003c/div\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n### 4. Start developing\n\n```bash\n# Start Django's dev server with a parallel Tailwind watcher (recommended)\npython manage.py tailwind runserver\n\n# Or run build and watch separately\npython manage.py tailwind watch  # In one terminal\npython manage.py runserver       # In another terminal\n```\n\nThe watcher runs under Django's own auto-reloader, so editing `settings.py` (e.g. adding a new app) restarts it automatically and picks up the new configuration on the fly. Pass `--noreload` to opt out.\n\nFirst run creates a managed `\u003cBASE_DIR\u003e/.django_tailwind_cli/` directory for the CLI binary and an auto-generated `source.css`. The directory is automatically git-ignored — no entry in your project-level `.gitignore` needed.\n\n\u003e **Tip:** Prefer a guided walkthrough? Run `python manage.py tailwind setup` instead for an interactive step-by-step first-time setup.\n\n### 🎉 You're ready to go!\n\nStart adding Tailwind classes to your templates:\n\n```html\n{% extends \"base.html\" %}\n\n{% block content %}\n\u003cdiv class=\"max-w-4xl mx-auto py-12\"\u003e\n    \u003ch1 class=\"text-4xl font-bold text-gray-900 mb-8\"\u003e\n        Welcome to Django + Tailwind!\n    \u003c/h1\u003e\n    \u003cp class=\"text-lg text-gray-600\"\u003e\n        This text is styled with Tailwind CSS.\n    \u003c/p\u003e\n    \u003cbutton class=\"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded mt-4\"\u003e\n        Click me!\n    \u003c/button\u003e\n\u003c/div\u003e\n{% endblock %}\n```\n\n📚 **Next Steps:** Check out the [full documentation](https://django-tailwind-cli.rtfd.io/) for advanced configuration and usage patterns.\n\n## 🎯 Core Features\n\n### 🏗️ Build System\n- **Automatic CLI download** - No manual setup required\n- **Smart caching** - Faster rebuilds with file change detection\n- **Production optimization** - Automatic CSS purging and minification\n- **Force rebuild** - `--force` flag for clean builds\n\n### 🔧 Development Tools\n- **Interactive setup** - `python manage.py tailwind setup`\n- **Configuration viewer** - `python manage.py tailwind config`\n- **Troubleshooting guide** - `python manage.py tailwind troubleshoot`\n\n### 🎨 Styling Features\n- **Tailwind CSS 4.x** - Latest features and performance improvements\n- **DaisyUI integration** - Pre-built components via [tailwindcss-cli-extra](https://github.com/dobicinaitis/tailwind-cli-extra)\n- **Custom CSS support** - Bring your own styles and configurations\n- **Template tag** - Simple `{% tailwind_css %}` inclusion\n\n### ⚡ Performance\n- **File change detection** - Only rebuild when necessary\n- **Concurrent processing** - Parallel build and server processes\n- **Progress indicators** - Visual feedback during downloads and builds\n- **Verbose logging** - Detailed diagnostics with `--verbose`\n\n### 🛠️ Management Commands\n\n| Command        | Purpose                                              | Example                                  |\n| -------------- | ---------------------------------------------------- | ---------------------------------------- |\n| `setup`        | Interactive first-time setup guide                   | `python manage.py tailwind setup`        |\n| `build`        | Production CSS build                                 | `python manage.py tailwind build`        |\n| `watch`        | Development file watcher (Django autoreload by default) | `python manage.py tailwind watch`    |\n| `runserver`    | Django dev server + watcher (forwards any runserver flag) | `python manage.py tailwind runserver` |\n| `config`       | Show current configuration                           | `python manage.py tailwind config`       |\n| `troubleshoot` | Debug common issues                                  | `python manage.py tailwind troubleshoot` |\n\n`tailwind runserver` is a transparent passthrough: every positional argument and option (apart from `--force-default-runserver`) is forwarded verbatim to the underlying `runserver` or `runserver_plus`. Every flag those commands accept works — including `runserver_plus`-only ones like `--extra-file`, `--reloader-interval`, and `--print-sql`.\n\n## 📋 Requirements\n\n- **Python:** 3.10+\n- **Django:** 4.2 LTS, 5.2, or 6.0\n- **Platform:** Windows, macOS, Linux (automatic platform detection)\n\n## ⚙️ Configuration Examples\n\n### Basic Configuration\n```python\n# settings.py\nSTATICFILES_DIRS = [BASE_DIR / \"assets\"]\n```\n\n### Advanced Configuration\n```python\n# Pin specific Tailwind version\nTAILWIND_CLI_VERSION = \"4.1.3\"\n\n# Custom CSS paths\nTAILWIND_CLI_SRC_CSS = \"src/styles/main.css\"\nTAILWIND_CLI_DIST_CSS = \"css/app.css\"\n\n# Enable DaisyUI\nTAILWIND_CLI_USE_DAISY_UI = True\n\n# Use an already-installed Tailwind binary (e.g. `brew install tailwindcss`)\nTAILWIND_CLI_USE_SYSTEM_BINARY = True\n\n# Auto-inject @source directives for editable-installed external apps (opt-in)\nTAILWIND_CLI_AUTO_SOURCE_EXTERNAL_APPS = True\n```\n\n### Production Settings\n```python\n# Optimized for production\nTAILWIND_CLI_VERSION = \"4.1.3\"  # Pin version\nTAILWIND_CLI_AUTOMATIC_DOWNLOAD = False  # Use pre-installed CLI\nTAILWIND_CLI_DIST_CSS = \"css/tailwind.min.css\"\n```\n\n## 🔍 Troubleshooting\n\n### Common Issues\n\n**CSS not updating?**\n```bash\npython manage.py tailwind build --force\npython manage.py tailwind troubleshoot\n```\n\n**Configuration problems?**\n```bash\npython manage.py tailwind config\npython manage.py tailwind setup\n```\n\n**Missing templates?**\nMake sure every template directory is covered by an `@source` directive in your\nTailwind CSS input file — Tailwind CSS 4.x discovers templates exclusively\nthrough those directives.\n\n### Performance Tips\n\n1. **Use file watching:** `python manage.py tailwind runserver` for automatic rebuilds\n2. **Declare template sources explicitly:** Use `@source` directives in your CSS so Tailwind only scans what you need\n3. **Optimize builds:** Use `--force` only when necessary\n4. **Monitor file changes:** Use `--verbose` for detailed logging\n\n## 🎨 DaisyUI Integration\n\nEnable beautiful pre-built components:\n\n```python\n# settings.py\nTAILWIND_CLI_USE_DAISY_UI = True\n```\n\n```html\n\u003c!-- Use DaisyUI components --\u003e\n\u003cbutton class=\"btn btn-primary\"\u003ePrimary Button\u003c/button\u003e\n\u003cdiv class=\"card bg-base-100 shadow-xl\"\u003e\n    \u003cdiv class=\"card-body\"\u003e\n        \u003ch2 class=\"card-title\"\u003eCard Title\u003c/h2\u003e\n        \u003cp\u003eCard content goes here.\u003c/p\u003e\n    \u003c/div\u003e\n\u003c/div\u003e\n```\n\n## 📚 Documentation \u0026 Resources\n\n- **📖 Full Documentation:** [django-tailwind-cli.rtfd.io](https://django-tailwind-cli.rtfd.io/)\n- **🎯 Tailwind CSS Docs:** [tailwindcss.com](https://tailwindcss.com)\n- **🧩 DaisyUI Components:** [daisyui.com](https://daisyui.com)\n- **💬 Django Commons:** [github.com/django-commons](https://github.com/django-commons)\n\n## 🔗 Related Projects\n\n- **tailwindcss-cli-extra:** [DaisyUI-enabled CLI](https://github.com/dobicinaitis/tailwind-cli-extra)\n- **Django Extensions:** [Extended runserver features](https://django-extensions.readthedocs.io/)\n- **Tailwind CSS IntelliSense:** [VS Code extension](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss)\n\n## 🤝 Contributing\n\nWe welcome contributions! This project uses modern Python tooling for development.\n\n### Prerequisites\n\n- **[uv](https://docs.astral.sh/uv/)** - Fast Python package manager\n- **[just](https://github.com/casey/just)** - Command runner (optional but recommended)\n\n### Quick Development Setup\n\n```bash\n# Clone the repository\ngit clone https://github.com/django-commons/django-tailwind-cli.git\ncd django-tailwind-cli\n\n# Setup development environment (with just)\njust bootstrap\n\n# Or setup manually with uv\nuv venv\nuv sync --all-extras\n```\n\n### Development Commands\n\n```bash\n# With just (recommended)\njust upgrade          # Update dependencies\njust lint             # Run linting and formatting\njust test             # Run test suite\njust test-all         # Run tests across Python/Django versions\n\n# Without just\nuv sync --all-extras  # Update dependencies\nuvx pre-commit run --all-files  # Run linting\nuv run pytest        # Run tests\nuvx --with tox-uv tox # Run full test matrix\n```\n\n### Contribution Guidelines\n\n1. **🍴 Fork** the repository\n2. **🌿 Create** a feature branch (`git checkout -b feature/amazing-feature`)\n3. **✅ Test** your changes (`just test`)\n4. **📝 Commit** with conventional commits (`feat:`, `fix:`, `docs:`, etc.)\n5. **📤 Push** to your branch (`git push origin feature/amazing-feature`)\n6. **🔄 Create** a Pull Request\n\n### Code Quality\n\n- **Type hints** for all new code\n- **Tests** for new features and bug fixes\n- **Documentation** updates for user-facing changes\n- **Conventional commits** for clear history\n\n## License\n\nThis software is licensed under [MIT license](https://github.com/django-commons/django-tailwind-cli/blob/main/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjango-commons%2Fdjango-tailwind-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdjango-commons%2Fdjango-tailwind-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjango-commons%2Fdjango-tailwind-cli/lists"}