From 81ab0772ed75da1642a5912f4aa9e30989734be6 Mon Sep 17 00:00:00 2001 From: DK Benjamin Date: Tue, 1 Oct 2024 10:41:42 -0400 Subject: [PATCH] Add private ip to allowed_hosts setting to enable load balancer health checks --- backend/aiproject/settings.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/aiproject/settings.py b/backend/aiproject/settings.py index 5b10632e..2c4cf2b7 100644 --- a/backend/aiproject/settings.py +++ b/backend/aiproject/settings.py @@ -15,6 +15,7 @@ import dj_database_url import environ from corsheaders.defaults import default_headers +from socket import gethostbyname, gethostname env = environ.Env() @@ -36,7 +37,7 @@ default="https://api-prod.raw-data.hotosm.org/v1", ) -ALLOWED_HOSTS = ["localhost", "127.0.0.1", HOSTNAME] +ALLOWED_HOSTS = ["localhost", "127.0.0.1", HOSTNAME, gethostbyname(gethostname())] CORS_ALLOW_HEADERS = list(default_headers) + [ "access-token", ]