feat: enable environment variable overrides for static and media roots
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:
@@ -203,9 +203,9 @@ USE_TZ = True
|
||||
|
||||
# --- Static files ---
|
||||
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/"
|
||||
|
||||
# --- Storage (S3 or local) ---
|
||||
|
||||
Reference in New Issue
Block a user