# How to setup the library
This guide will take you through the steps to integrate Tailwind CSS into your Django project, including the necessary configurations, installing dependencies, and compiling CSS files. In the end, you will have a development-ready system with Tailwind CSS integrated.
**Before starting, make sure you are in the main project folder**
## Step 1
Paste the following code in your terminal to download the library in your project.
Windows:
```bash
pip install tailwind_for_django
```
Mac:
```bash
pip3 install tailwind_for_django
```
## Step 2
In your settings.py the following line in the INSTALLED_APPS array.
```bash
'tailwind_for_django'
```
## Step 3
Now run the following command:
If you are in window:
```bash
python manage.py setup_tailwind
```
If you are in mac:
```bash
python3 manage.py setup_tailwind
```
## Step 4
Update your settings.py with this 2 line of code:
```bash
STATIC_URL = '/static/'
STATICFILES_DIRS = [BASE_DIR / 'static']
```
## Step 5
Enter in static -> css -> input_tailwind.css and **remove the example line (the line start with //)**
## Step 6
Run the following script:
```bash
npm run build_tailwind
```
## Step 7
In your templates insert the following code:
```bash
{% load static %}
<link href="{% static 'css/output_tailwind.css' %}" rel="stylesheet">
```
If you have some cache problem and your template style not update pass at your view **time** and change to the following code
```bash
{% load static %}
<link href="{% static 'css/output_tailwind.css' %}?v={{ time.time }}" rel="stylesheet">
```
## Final
Now you have tailwindcss installed on your django project.
Raw data
{
"_id": null,
"home_page": "https://github.com/AndreaGallini/tailwind_for_django",
"name": "tailwind-for-django",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Andrea Gallini",
"author_email": "tuo_email@example.com",
"download_url": "https://files.pythonhosted.org/packages/b2/fc/83e92bba34f9b6227930b586e10c7a9d3f3f32dbced2ebe67e54f86f669e/tailwind_for_django-0.1.7.tar.gz",
"platform": null,
"description": "# How to setup the library\n\nThis guide will take you through the steps to integrate Tailwind CSS into your Django project, including the necessary configurations, installing dependencies, and compiling CSS files. In the end, you will have a development-ready system with Tailwind CSS integrated.\n\n **Before starting, make sure you are in the main project folder**\n## Step 1\n\nPaste the following code in your terminal to download the library in your project.\nWindows:\n```bash\npip install tailwind_for_django\n```\nMac:\n```bash\npip3 install tailwind_for_django\n```\n## Step 2 \n\nIn your settings.py the following line in the INSTALLED_APPS array.\n```bash\n'tailwind_for_django'\n```\n\n## Step 3\n\nNow run the following command:\n\nIf you are in window:\n```bash\npython manage.py setup_tailwind\n```\nIf you are in mac:\n```bash\npython3 manage.py setup_tailwind\n```\n\n## Step 4\n\nUpdate your settings.py with this 2 line of code:\n```bash\nSTATIC_URL = '/static/'\nSTATICFILES_DIRS = [BASE_DIR / 'static']\n```\n\n## Step 5 \nEnter in static -> css -> input_tailwind.css and **remove the example line (the line start with //)**\n\n## Step 6\nRun the following script:\n```bash\nnpm run build_tailwind\n```\n\n## Step 7\nIn your templates insert the following code:\n```bash\n{% load static %}\n<link href=\"{% static 'css/output_tailwind.css' %}\" rel=\"stylesheet\">\n```\nIf you have some cache problem and your template style not update pass at your view **time** and change to the following code\n```bash\n{% load static %}\n<link href=\"{% static 'css/output_tailwind.css' %}?v={{ time.time }}\" rel=\"stylesheet\">\n```\n\n## Final \n\nNow you have tailwindcss installed on your django project.\n\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "A library for easy setup of tailwind in django project",
"version": "0.1.7",
"project_urls": {
"Homepage": "https://github.com/AndreaGallini/tailwind_for_django"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e317675a704657cd4f92cc31f61ed92a4af8b066e8bc5ae3ea127d91cfaf7c71",
"md5": "6303fa3d534082032d91be73e0784e5b",
"sha256": "d4e896e0aa0f1fbc6254ed027d22254e47669eb8fa0603d0efd5ba1b04b961dc"
},
"downloads": -1,
"filename": "tailwind_for_django-0.1.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6303fa3d534082032d91be73e0784e5b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 4197,
"upload_time": "2024-11-05T20:01:14",
"upload_time_iso_8601": "2024-11-05T20:01:14.413263Z",
"url": "https://files.pythonhosted.org/packages/e3/17/675a704657cd4f92cc31f61ed92a4af8b066e8bc5ae3ea127d91cfaf7c71/tailwind_for_django-0.1.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b2fc83e92bba34f9b6227930b586e10c7a9d3f3f32dbced2ebe67e54f86f669e",
"md5": "373771621315e53682f481b567954529",
"sha256": "e6178ea4ce45e756275dd65db1fb93ee5f6a86f19a01698cc7e3e4e84d766f8b"
},
"downloads": -1,
"filename": "tailwind_for_django-0.1.7.tar.gz",
"has_sig": false,
"md5_digest": "373771621315e53682f481b567954529",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3465,
"upload_time": "2024-11-05T20:01:17",
"upload_time_iso_8601": "2024-11-05T20:01:17.050030Z",
"url": "https://files.pythonhosted.org/packages/b2/fc/83e92bba34f9b6227930b586e10c7a9d3f3f32dbced2ebe67e54f86f669e/tailwind_for_django-0.1.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-05 20:01:17",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "AndreaGallini",
"github_project": "tailwind_for_django",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "tailwind-for-django"
}