Skip to content

Commit 2f8ea9f

Browse files
committed
Updates Getting Started
1 parent 7a311c1 commit 2f8ea9f

File tree

2 files changed

+54
-15
lines changed

2 files changed

+54
-15
lines changed

README.md

Lines changed: 53 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,73 @@
22
![Django Tailwind Demo](https://raw.githubusercontent.com/timonweb/django-tailwind/master/docs/django-tailwind-demo-800.gif)
33

44
## Goal
5-
This project aims to provide a comfortable way of using the *Tailwind CSS* framework within a Django project.
5+
This project aims to provide a convenient way to use the *Tailwind CSS* framework within a Django project.
66

77
## Features
88
* An opinionated *Tailwind CSS* setup that makes your life easier;
99
* Hot reloading of CSS, configuration files, and *Django* templates. No more manual page refreshes!
10-
* Out of the box support for CSS imports, SASS-like variables, and nesting;
10+
* Out of the box support for CSS imports, Sass-like variables, and nesting;
1111
* Supports the latest *Tailwind CSS* `v4.x`;
1212
* Start both *Tailwind CSS* and *Django* development servers with a single command;
1313

1414
## Requirements
15-
Python 3.10 or newer with Django >= 4.2.20 or newer.
15+
Python 3.10 or newer and Django 4.2.20 or newer.
1616

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

20-
## Installation
21-
Via PIP:
22-
```bash
23-
pip install django-tailwind
24-
```
20+
## Getting Started
2521

26-
[RECOMMENDED IN DEV] If you want to use automatic page reloads during development use the `[reload]` extras, which installs the `django-browser-reload` package in addition:
22+
1. **Install django-tailwind:**
23+
```bash
24+
pip install django-tailwind
25+
```
2726

28-
```bash
29-
pip install 'django-tailwind[reload]'
30-
```
27+
2. **Add to INSTALLED_APPS in settings.py:**
28+
```python
29+
INSTALLED_APPS = [
30+
# ...
31+
'tailwind',
32+
]
33+
```
3134

32-
Check docs for the [Installation](https://django-tailwind.readthedocs.io/en/latest/installation.html) instructions.
35+
3. **Create Tailwind app:**
36+
```bash
37+
python manage.py tailwind init
38+
```
39+
40+
4. **Add the generated app to INSTALLED_APPS and configure:**
41+
```python
42+
INSTALLED_APPS = [
43+
# ...
44+
'tailwind',
45+
'theme', # your generated app name
46+
]
47+
48+
TAILWIND_APP_NAME = 'theme'
49+
```
50+
51+
5. **Install Tailwind CSS dependencies:**
52+
```bash
53+
python manage.py tailwind install
54+
```
55+
56+
6. **Start development (runs Django + Tailwind):**
57+
```bash
58+
python manage.py tailwind dev
59+
```
60+
61+
7. **Use Tailwind classes in your templates:**
62+
```html
63+
{% load tailwind_tags %}
64+
<link href="{% tailwind_css %}" rel="stylesheet">
65+
66+
<h1 class="text-4xl font-bold text-blue-600">Hello Tailwind!</h1>
67+
```
68+
69+
That's it! 🎉 Your Django project now has Tailwind CSS with hot reloading.
70+
71+
For configuring automatic page reloads during development, see the [Installation](docs/installation.md) instructions.
3372

3473
## Bugs and suggestions
3574

docs/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
python -m pip install django-tailwind
99
```
1010

11-
If you want to use automatic page reloads during development (see steps 9-12 below),
11+
[RECOMMENDED IN DEV] If you want to use automatic page reloads during development (see steps 9-12 below),
1212
use the `[reload]` extras, which installs the `django-browser-reload` package
1313
in addition:
1414

0 commit comments

Comments
 (0)