diff --git a/inventory/Inventory/settings.py b/inventory/Inventory/settings.py index c3159aab66..b806e39cba 100644 --- a/inventory/Inventory/settings.py +++ b/inventory/Inventory/settings.py @@ -43,6 +43,7 @@ # Application definition INSTALLED_APPS = [ + 'corsheaders', # CORS HEADERS 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', @@ -58,6 +59,7 @@ ] MIDDLEWARE = [ + 'corsheaders.middleware.CorsMiddleware', # CORS HEADERS 'django.middleware.security.SecurityMiddleware', 'whitenoise.middleware.WhiteNoiseMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', @@ -68,6 +70,11 @@ 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] +CORS_ALLOWED_ORIGINS = [ + "https://staging-platform.airqo.net", + "https://platform.airqo.net", +] + ROOT_URLCONF = 'Inventory.urls' TEMPLATES = [ diff --git a/inventory/requirements.txt b/inventory/requirements.txt index e2a85a0ced..9d76c85afc 100644 --- a/inventory/requirements.txt +++ b/inventory/requirements.txt @@ -68,3 +68,4 @@ zipp==3.16.2 django-simple-history==3.3.0 python-decouple==3.8 python-dotenv==1.0.0 +django-cors-headers==4.3.0