diff --git a/polisplexity/settings.py b/polisplexity/settings.py index 30db852..db6754d 100644 --- a/polisplexity/settings.py +++ b/polisplexity/settings.py @@ -15,7 +15,15 @@ sys.path.append(str(BASE_DIR)) # Core security settings SECRET_KEY = os.getenv("SECRET_KEY") DEBUG = os.getenv("DEBUG", "False") == "True" -ALLOWED_HOSTS = os.getenv("ALLOWED_HOSTS", "").split(",") +import os + +_raw = os.getenv("ALLOWED_HOSTS", "") +ALLOWED_HOSTS = [h.strip() for h in _raw.split(",") if h.strip()] # from .env if present + +# Hotfix: always allow local calls from inside container & host mapping +for h in ("127.0.0.1", "localhost"): + if h not in ALLOWED_HOSTS: + ALLOWED_HOSTS.append(h) # Application definition INSTALLED_APPS = [