From b1a221a8e8303380b679dd10513c96db1ef11177 Mon Sep 17 00:00:00 2001 From: jedi Date: Sat, 21 Oct 2023 18:44:43 +0200 Subject: [PATCH] add CSRF_TRUSTED_ORIGINS in settings --- backend/backend/settings.py | 2 ++ backend/requirements.txt | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/backend/settings.py b/backend/backend/settings.py index 8c89031..411c8f7 100644 --- a/backend/backend/settings.py +++ b/backend/backend/settings.py @@ -81,6 +81,8 @@ MIDDLEWARE = [ ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', '').split(',') +CSRF_TRUSTED_ORIGINS = ['https://' + host for host in ALLOWED_HOSTS] + CORS_ALLOW_ALL_ORIGINS = True ROOT_URLCONF = 'backend.urls' diff --git a/backend/requirements.txt b/backend/requirements.txt index 1b2aed0..06b3ce1 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -5,6 +5,7 @@ charset-normalizer==3.1.0 coreapi==2.3.3 coreschema==0.0.4 coverage==7.2.7 +Cython==3.0.4 Django==4.2.2 django-annoying==0.10.6 django-cors-headers==4.1.0 @@ -27,7 +28,7 @@ pycparser==2.21 PyNaCl==1.5.0 python-dotenv==1.0.0 pytz==2023.3 -PyYAML==6.0 +PyYAML==6.0.1 requests==2.31.0 ruamel.yaml==0.17.31 ruamel.yaml.clib==0.2.7