A library for easy setup of tailwind in django project
Project description
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:
pip install tailwind_for_django
Mac:
pip3 install tailwind_for_django
Step 2
In your settings.py the following line in the INSTALLED_APPS array.
'tailwind_for_django'
Step 3
Now run the following command:
If you are in window:
python manage.py setup_tailwind
If you are in mac:
python3 manage.py setup_tailwind
Step 4
Update your settings.py with this 2 line of code:
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:
npm run build_tailwind
Step 7
In your templates insert the following code:
{% load static %}
<link href="{% static '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
{% load static %}
<link href="{% static 'output_tailwind.css' %}?v={{ time.time }}" rel="stylesheet">
Final
Now you have tailwindcss installed on your django project.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tailwind_for_django-0.1.6.tar.gz.
File metadata
- Download URL: tailwind_for_django-0.1.6.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3b2cca88483883b3a25300fae756fa50339686cf36b7b7324b17c73088e1a0a
|
|
| MD5 |
37b916171e4383bae250294e89a1e6db
|
|
| BLAKE2b-256 |
a3a6fe608e8ef62be5d4b8f7454718f91f564933fe65fa2890a251aca83e4bbc
|
File details
Details for the file tailwind_for_django-0.1.6-py3-none-any.whl.
File metadata
- Download URL: tailwind_for_django-0.1.6-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c277545557f6eb147f782502462b4a6ec96670d719f9f4b58be92e50e07f06a
|
|
| MD5 |
ee777f37f68d846ae580ec9549242315
|
|
| BLAKE2b-256 |
320a547e5e36b78478f08b991ac6ae13d0eedec6c61956023336e3113254c950
|