From 60ace6b1970e01670b9b141384ad006ba1f0cfdf Mon Sep 17 00:00:00 2001 From: Ekaropolus Date: Thu, 18 Sep 2025 14:28:58 -0600 Subject: [PATCH] Allowed local for Internet of Agents --- polisplexity/settings.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 = [