Dockerize Django app with dev/beta/prod env config and uv #6

Merged
westfarn merged 5 commits from feature/4-dockerize-with-env-config into master 2026-07-07 11:23:50 -07:00
Showing only changes of commit 5d378b7b19 - Show all commits
@@ -1,5 +1,6 @@
"""Shared Django settings for all environments."""
import json
import os
from pathlib import Path
from urllib.parse import urlparse
@@ -22,6 +23,15 @@ def env_list(key: str, default: str = "") -> list[str]:
value = os.environ.get(key, default)
if not value:
return []
value = value.strip()
# Accept a JSON array (e.g. '["a","b"]') as well as a comma-separated list.
if value.startswith("["):
try:
parsed = json.loads(value)
except ValueError:
parsed = None
if isinstance(parsed, list):
return [str(item).strip() for item in parsed if str(item).strip()]
return [item.strip() for item in value.split(",") if item.strip()]