1
Fork 0
mirror of https://github.com/Steffo99/sophon.git synced 2024-12-22 06:44:21 +00:00

Add corsheaders app

This commit is contained in:
Steffo 2021-09-10 16:40:41 +02:00
parent 000fd5aa4d
commit 8b5a44a50d
2 changed files with 9 additions and 1 deletions

View file

@ -11,8 +11,9 @@
<env name="DJANGO_TIME_ZONE" value="CET" />
<env name="APACHE_PROXY_BASE_DOMAIN" value="dev.sophon.steffo.eu" />
<env name="APACHE_PROXY_HTTP_PROTOCOL" value="http" />
<env name="DJANGO_CORS_ALLOWED_ORIGINS" value="http://localhost:3000" />
</envs>
<option name="SDK_HOME" value="$USER_HOME$/.cache/pypoetry/virtualenvs/sophon-oyAYqTyT-py3.9/bin/python" />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="false" />

View file

@ -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/"