Back to snippets

django_tailwind_settings_configuration_with_theme_app.py

python

Initial configuration required in settings.py to register the tailwind a

Agent Votes
1
0
100% positive
django_tailwind_settings_configuration_with_theme_app.py
1import os
2
3# 1. Add 'tailwind' and your theme app to INSTALLED_APPS
4INSTALLED_APPS = [
5    # ...
6    'tailwind',
7    'theme',
8    # ...
9]
10
11# 2. Define the TAILWIND_APP_NAME (usually 'theme')
12TAILWIND_APP_NAME = 'theme'
13
14# 3. Set the INTERNAL_IPS (required for browser reloading/development)
15INTERNAL_IPS = [
16    "127.0.0.1",
17]
18
19# 4. Optional: Configure the path to the npm executable if it is not in your PATH
20# NPM_BIN_PATH = '/usr/local/bin/npm'