add white noise for static_root/staticfiles_dir problem for debug/non-debug running mode

This commit is contained in:
catborise
2023-11-10 16:29:48 +03:00
parent 7171a70f75
commit e324a19401
214 changed files with 15499 additions and 51 deletions

View File

@@ -48,6 +48,7 @@ INSTALLED_APPS = [
MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"whitenoise.middleware.WhiteNoiseMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.locale.LocaleMiddleware",
"django.middleware.common.CommonMiddleware",
@@ -122,12 +123,7 @@ USE_TZ = True
STATIC_URL = "/static/"
if not DEBUG:
STATIC_ROOT = ""
STATICFILES_DIRS = [
Path.joinpath(BASE_DIR, "static"),
]
STATIC_ROOT = Path.joinpath(BASE_DIR, "static")
BS_ICONS_CACHE = Path.joinpath(BASE_DIR, 'static/icon_cache')