Skip to main content

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:

tailwind npm run build-css

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

tailwind_for_django-0.1.5.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tailwind_for_django-0.1.5-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file tailwind_for_django-0.1.5.tar.gz.

File metadata

  • Download URL: tailwind_for_django-0.1.5.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

Hashes for tailwind_for_django-0.1.5.tar.gz
Algorithm Hash digest
SHA256 e779366858515df458ba3fb0f94b93b1e94de0b7060336197fb74c772cc1c734
MD5 2e33ad81309195b0a7541a88d91c8c30
BLAKE2b-256 4fe3fe2cd981d658917008f1fb6cbfbe3ee9b1f96232e302a8e456939488b59b

See more details on using hashes here.

File details

Details for the file tailwind_for_django-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for tailwind_for_django-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 527032b7143c6ab19c3c962aba42f5338ea57cd637a7b9a7e37640df448f821c
MD5 fa3e2e452bf25acb9f0e830b16c68904
BLAKE2b-256 594ba5e414efd47b746cad15718361c2a070f078619b36b82bf76e96063edae2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page