Skip to content

Commit f0bbbce

Browse files
committed
Add django-tailwind library and initial configuration.
1 parent cd3c9b9 commit f0bbbce

File tree

17 files changed

+2183
-11927
lines changed

17 files changed

+2183
-11927
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,4 +208,4 @@ bower_components
208208
assets/
209209
node_modules
210210

211-
djangosnippets/static/css/site.css
211+
theme/static/css/dist/styles.css

README.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ In a Python 3.11 virtual environment::
5050
$ cd requirements
5151
$ pip install -r development.txt
5252
$ cd ..
53+
$ python manage.py tailwind install
5354
$ python manage.py migrate
5455

5556
Now you can start the development server::
@@ -63,9 +64,9 @@ are included in the fixtures folder. Also included are five snippets to get you
6364
$ python manage.py createsuperuser
6465
$ python manage.py loaddata fixtures/cab.json
6566

66-
You will need to build the site.css with tailwindcss::
67+
To use Tailwind, you need to start the Tailwind server::
6768

68-
$ npm run build
69+
$ python manage.py tailwind start
6970

7071
Now you should be able to use the development version of djangosnippets
7172
on port 8000.

djangosnippets/settings/base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ def user_url(user):
6161
"comments_spamfighter",
6262
"ratings",
6363
"taggit",
64+
"tailwind",
65+
"theme",
6466
"django_recaptcha",
6567
"django_extensions",
6668
"rest_framework",
@@ -104,6 +106,7 @@ def user_url(user):
104106
STATIC_URL = "/assets/static/"
105107
STATIC_ROOT = os.path.join(PROJECT_ROOT, "..", "assets", "static")
106108
STATICFILES_DIRS = (os.path.join(PROJECT_ROOT, "static"),)
109+
TAILWIND_APP_NAME = "theme"
107110

108111
SESSION_ENGINE = "django.contrib.sessions.backends.cached_db"
109112
MESSAGE_STORAGE = "django.contrib.messages.storage.session.SessionStorage"

0 commit comments

Comments
 (0)