fix: missing cors whitelist

This commit is contained in:
2024-06-20 18:15:34 +02:00
parent 991cdd0cf1
commit 955f3234b3
2 changed files with 7 additions and 0 deletions
+5
View File
@@ -7,6 +7,11 @@ VERSION = "0.1.0"
CORS_ORIGIN_ALLOW_ALL = DEBUG CORS_ORIGIN_ALLOW_ALL = DEBUG
if not DEBUG:
import socket
ALLOWED_HOSTS.append(socket.gethostbyname(socket.gethostname()))
DJANGO_APPS = [ DJANGO_APPS = [
"unfold", # before django.contrib.admin "unfold", # before django.contrib.admin
"django.contrib.admin", "django.contrib.admin",
+2
View File
@@ -14,6 +14,8 @@ if os.path.exists(env_file):
SECRET_KEY = env.str("SECRET_KEY", "this-is-the-default-secret-key") SECRET_KEY = env.str("SECRET_KEY", "this-is-the-default-secret-key")
DEBUG = env.bool("DEBUG", True) DEBUG = env.bool("DEBUG", True)
CORS_ORIGIN_WHITELIST = env.str('CORS_ORIGIN_WHITELIST', default='').split(',')
DATABASE_URL = env.db_url("DATABASE_URL", "sqlite:///db.sqlite3") DATABASE_URL = env.db_url("DATABASE_URL", "sqlite:///db.sqlite3")
STATIC_ROOT = env.str("STATIC_ROOT", "static") STATIC_ROOT = env.str("STATIC_ROOT", "static")