Commit 951a02a1 authored by Ilham Maulana's avatar Ilham Maulana 💻

fix: staticfiles settings

parent 8c784eab
......@@ -7,6 +7,7 @@
media
uploads
static
staticfiles
# Backup files #
*.bak
......
......@@ -68,6 +68,8 @@ MIDDLEWARE = [
"django.middleware.clickjacking.XFrameOptionsMiddleware",
# local
"users.middleware.AuthMiddleware",
# 3rd party
"whitenoise.middleware.WhiteNoiseMiddleware",
]
ROOT_URLCONF = "config.urls"
......@@ -149,8 +151,9 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/5.0/howto/static-files/
STATIC_URL = "/static/"
STATIC_URL = "static/"
STATIC_ROOT = BASE_DIR / "staticfiles"
STATICFILES_DIRS = [BASE_DIR / "static"]
MEDIA_URL = "/media/"
MEDIA_ROOT = BASE_DIR
......@@ -160,7 +163,7 @@ STORAGES = {
"BACKEND": "django.core.files.storage.FileSystemStorage",
},
"staticfiles": {
"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage",
"BACKEND": "whitenoise.storage.CompressedManifestStaticFilesStorage",
},
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment