addTailwind CSS and HTMX selection support #45

Merged
S4NKALP merged 5 commits from dev into main 2026-04-20 09:09:57 +00:00
3 changed files with 51 additions and 2 deletions
Showing only changes of commit d741249644 - Show all commits

No files matched your search

@@ -26,6 +26,8 @@ THIRD_PARTY_APPS = [
"rest_framework_simplejwt.token_blacklist",
"corsheaders",
"drf_spectacular",
"django_tailwind_cli", # @IF use_tailwind
"django_htmx", # @IF use_htmx
]
USER_DEFINED_APPS = [
@@ -56,6 +58,7 @@ MIDDLEWARE = [
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
"django_htmx.middleware.HtmxMiddleware", # @IF use_htmx
]
ROOT_URLCONF = "[[ project_name ]].urls"
@@ -106,10 +109,10 @@ USE_I18N = True
USE_TZ = True
# Static files and media files
STATIC_URL = "static/"
STATIC_URL = "/static/"
STATIC_ROOT = BASE_DIR / "staticfiles"
MEDIA_URL = "media/"
MEDIA_URL = "/media/"
MEDIA_ROOT = BASE_DIR / "media"
STORAGES = {
@@ -185,3 +188,40 @@ CORS_PREFLIGHT_MAX_AGE = 86400 # 24 hours
SECURE_BROWSER_XSS_FILTER = True
SECURE_CONTENT_TYPE_NOSNIFF = True
X_FRAME_OPTIONS = "DENY"
# @IF use_tailwind
# for tailwind
STATICFILES_DIRS = [BASE_DIR / "static/"]
TAILWIND_CLI_VERSION = "2.7.8"
TAILWIND_CLI_USE_DAISY_UI = True
TAILWIND_CLI_CONFIG = {
"theme": {
"extend": {
"colors": {
"primary": "#DC2626",
"secondary": "#EF4444",
"accent": "#FCFECC",
}
}
},
"daisyui": {
"themes": [
{
"light": {
"primary": "#DC2626",
"secondary": "#EF4444",
"accent": "#FCFECC",
"neutral": "#1a1a2e",
"base-100": "#ffffff",
"base-200": "#f8fafc",
"base-300": "#e2e8f0",
"info": "#0E4D80",
"success": "#16a34a",
"warning": "#f59e0b",
"error": "#DC2626",
}
}
]
},
}
# @ENDIF
@@ -65,3 +65,10 @@ CSRF_COOKIE_SECURE = True
# Static files
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
# @IF use_tailwind
## Tailwind
TAILWIND_CLI_VERSION = "4.1.3" # Pin version
TAILWIND_CLI_AUTOMATIC_DOWNLOAD = False # Use pre-installed CLI
TAILWIND_CLI_DIST_CSS = "static/css/tailwind.min.css"
# @ENDIF
@@ -10,6 +10,8 @@ djangorestframework_simplejwt
drf-spectacular
django-cors-headers
whitenoise
django-tailwind-cli # @IF use_tailwind
django-htmx # @IF use_htmx
# @IF database_type == 'mysql'
mysqlclient
# @ELSE