diff --git a/.idea/runConfigurations/Start_sophon_backend.xml b/.idea/runConfigurations/Start_sophon_backend.xml
index cded905..92070dc 100644
--- a/.idea/runConfigurations/Start_sophon_backend.xml
+++ b/.idea/runConfigurations/Start_sophon_backend.xml
@@ -11,8 +11,9 @@
+
-
+
diff --git a/backend/sophon/settings.py b/backend/sophon/settings.py
index 6fb9104..6273572 100644
--- a/backend/sophon/settings.py
+++ b/backend/sophon/settings.py
@@ -41,6 +41,7 @@ INSTALLED_APPS = [
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.postgres',
+ 'corsheaders',
'rest_framework',
'rest_framework.authtoken',
'sophon.core',
@@ -49,6 +50,7 @@ INSTALLED_APPS = [
]
MIDDLEWARE = [
+ 'corsheaders.middleware.CorsMiddleware',
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
@@ -197,3 +199,8 @@ LOGGING = {
"handlers": ["console"],
}
}
+
+# CORS
+
+CORS_ALLOWED_ORIGINS = os.environ["DJANGO_CORS_ALLOWED_ORIGINS"].split("|")
+CORS_URLS_REGEX = r"^/api/"