From 1cb7933e4f8dc78d2595671839fd15da69350447 Mon Sep 17 00:00:00 2001 From: J-E Castagnede Date: Tue, 9 Jul 2024 15:48:14 +0200 Subject: [PATCH] add django-cors-headers --- backend/project/settings/__init__.py | 2 ++ backend/requirements.in | 3 ++- backend/requirements.txt | 7 ++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/backend/project/settings/__init__.py b/backend/project/settings/__init__.py index a5af5fc..07d08d7 100644 --- a/backend/project/settings/__init__.py +++ b/backend/project/settings/__init__.py @@ -60,6 +60,7 @@ "drf_spectacular", "sorl.thumbnail", "treebeard", + "corsheaders", "project.api", "project.observations", "project.accounts", @@ -68,6 +69,7 @@ MIDDLEWARE = [ "django.middleware.security.SecurityMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", + "corsheaders.middleware.CorsMiddleware", "django.middleware.common.CommonMiddleware", "django.middleware.csrf.CsrfViewMiddleware", "django.middleware.locale.LocaleMiddleware", diff --git a/backend/requirements.in b/backend/requirements.in index 4f03fe5..13f149f 100644 --- a/backend/requirements.in +++ b/backend/requirements.in @@ -12,4 +12,5 @@ gunicorn drf-dynamic-fields djangorestframework-simplejwt django-treebeard -django-storages[s3] \ No newline at end of file +django-storages[s3] +django-cors-headers \ No newline at end of file diff --git a/backend/requirements.txt b/backend/requirements.txt index f8ffaeb..cf6350a 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -5,7 +5,9 @@ # pip-compile --strip-extras # asgiref==3.8.1 - # via django + # via + # django + # django-cors-headers attrs==23.2.0 # via # jsonschema @@ -21,12 +23,15 @@ certifi==2024.6.2 django==5.0.6 # via # -r requirements.in + # django-cors-headers # django-filter # django-storages # django-treebeard # djangorestframework # djangorestframework-simplejwt # drf-spectacular +django-cors-headers==4.4.0 + # via -r requirements.in django-filter==24.2 # via -r requirements.in django-storages==1.14.3