Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #31 from MaziniiX/main
Browse files Browse the repository at this point in the history
fix csrf list
  • Loading branch information
MaziniiX authored Jun 21, 2024
2 parents df65bfe + 053106c commit 98ac9f5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Django_Frontend/monprojet/monprojet/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
if ENVIRONMENT == 'development' or ENVIRONMENT == 'test':
ALLOWED_HOSTS = ['*']
else:
ALLOWED_HOSTS = "api" + os.getenv('DOMAIN')
ALLOWED_HOSTS = [os.getenv('DOMAIN')]

# Application definition

Expand All @@ -71,8 +71,8 @@
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

if ENVIRONMENT == 'production':
CSRF_TRUSTED_ORIGINS = os.getenv('DJANGO_ORIGIN').split(',')
if ENVIRONMENT != 'development':
CSRF_TRUSTED_ORIGINS = ["https://" + os.getenv('DOMAIN')]

ROOT_URLCONF = 'monprojet.urls'

Expand Down
6 changes: 3 additions & 3 deletions Django_api/airline/airline/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
if ENVIRONMENT == 'development' or ENVIRONMENT == 'test':
ALLOWED_HOSTS = ['*']
else:
ALLOWED_HOSTS = "api" + os.getenv('DOMAIN')
ALLOWED_HOSTS = ["api" + os.getenv('DOMAIN')]



Expand Down Expand Up @@ -68,8 +68,8 @@
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

if ENVIRONMENT == 'production':
CSRF_TRUSTED_ORIGINS = "https://api." + os.getenv('DOMAIN')
if ENVIRONMENT != 'development':
CSRF_TRUSTED_ORIGINS = ["https://api." + os.getenv('DOMAIN')]

ROOT_URLCONF = 'airline.urls'

Expand Down
2 changes: 2 additions & 0 deletions Docker-test/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ services:
context: ../
dockerfile: ./Docker-test/API/Dockerfile
environment:
DOMAIN: ${DOMAIN}
DJANGO_ENVIRONMENT: ${DJANGO_ENVIRONMENT}
DJANGO_DB_NAME: ${POSTGRES_DB}
DJANGO_DB_USER: ${POSTGRES_USER}
Expand Down Expand Up @@ -83,6 +84,7 @@ services:
context: ../
dockerfile: ./Docker-test/Frontend/Django/Dockerfile
environment:
DOMAIN: ${DOMAIN}
DJANGO_ENVIRONMENT: ${DJANGO_ENVIRONMENT}
DJANGO_DB_NAME: ${POSTGRES_DB}
DJANGO_DB_USER: ${POSTGRES_USER}
Expand Down

0 comments on commit 98ac9f5

Please sign in to comment.