spacexerq 1 settimana fa
parent
commit
542b8bff41
1 ha cambiato i file con 9 aggiunte e 1 eliminazioni
  1. 9 1
      services/spectrometer/mserv00/settings.py

+ 9 - 1
services/spectrometer/mserv00/settings.py

@@ -26,7 +26,15 @@ SECRET_KEY = 'django-insecure-89&_=swo6&=@z714%#k6oo$ayu-cn5yu9k@h$+bq^=kf$#f!c3
 # SECURITY WARNING: don't run with debug turned on in production!
 DEBUG = True
 
-ALLOWED_HOSTS = ['127.0.0.1', 'localhost']
+# Base hosts always allowed
+_ALLOWED_HOSTS = ['127.0.0.1', 'localhost', 'host.docker.internal']
+
+# Accept extra hosts from env (comma-separated), e.g. machine hostname or IP
+_extra = os.getenv('DJANGO_ALLOWED_HOSTS', '')
+if _extra:
+    _ALLOWED_HOSTS += [h.strip() for h in _extra.split(',') if h.strip()]
+
+ALLOWED_HOSTS = _ALLOWED_HOSTS
 
 
 # Application definition