This commit is contained in:
godd0t 2023-05-10 12:29:36 +02:00
parent 8d25240be4
commit 1ae2664984
2 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ APP_ENV=dev
DEBUG=True DEBUG=True
DJANGO_SETTINGS_MODULE=project_name.settings.dev DJANGO_SETTINGS_MODULE=project_name.settings.dev
ALLOWED_HOSTS='app.backend.dev' ALLOWED_HOSTS='app.backend.dev'
CSRF_TRUSTED_ORIGINS='http://app.backend.dev' CSRF_TRUSTED_ORIGINS='https://*.backend.dev'
CORS_ALLOWED_ORIGINS=http://app.backend.dev,http://localhost:3000 CORS_ALLOWED_ORIGINS=http://app.backend.dev,http://localhost:3000
# Postgres configuration variables # Postgres configuration variables

View File

@ -12,11 +12,11 @@ DEBUG = os_getenv("DEBUG", "true").lower() in ["True", "true", "1", "yes", "y"]
ALLOWED_HOSTS = os_getenv("ALLOWED_HOSTS", "localhost").split(",") ALLOWED_HOSTS = os_getenv("ALLOWED_HOSTS", "localhost").split(",")
CSRF_TRUSTED_ORIGINS = os_getenv("CSRF_TRUSTED_ORIGINS", "http://localhost").split(",")
if DEBUG: if DEBUG:
CORS_ORIGIN_ALLOW_ALL = True CORS_ORIGIN_ALLOW_ALL = True
else: else:
CSRF_TRUSTED_ORIGINS = os_getenv("CSRF_TRUSTED_ORIGINS", "http://localhost").split(",")
CORS_ALLOWED_ORIGINS = os_getenv("CORS_ALLOWED_ORIGINS", "http://localhost").split(",") CORS_ALLOWED_ORIGINS = os_getenv("CORS_ALLOWED_ORIGINS", "http://localhost").split(",")
# Application definition # Application definition