feat: enable environment variable overrides for static and media roots
All checks were successful
CVE Scan & Docker Build / security-scan (push) Successful in 50s
CVE Scan & Docker Build / build-and-push (push) Successful in 2m25s

Update STATIC_ROOT and MEDIA_ROOT in settings.py to read from
environment variables with default fallbacks to BASE_DIR paths.
This allows flexible deployment configurations without modifying
source code for different environments.
This commit is contained in:
2026-05-16 19:12:20 -04:00
parent 4fb3676204
commit f88ec30110

View File

@@ -203,9 +203,9 @@ USE_TZ = True
# --- Static files --- # --- Static files ---
STATIC_URL = "static/" STATIC_URL = "static/"
STATIC_ROOT = BASE_DIR / "staticfiles" STATIC_ROOT = Path(env("STATIC_ROOT", default=str(BASE_DIR / "staticfiles")))
MEDIA_ROOT = BASE_DIR / "media" MEDIA_ROOT = Path(env("MEDIA_ROOT", default=str(BASE_DIR / "media")))
MEDIA_URL = "/media/" MEDIA_URL = "/media/"
# --- Storage (S3 or local) --- # --- Storage (S3 or local) ---