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

Commit

Permalink
fix: add conditional trusted origins update (#563)
Browse files Browse the repository at this point in the history
* fix: add conditional trusted origins update
  • Loading branch information
UsamaSadiq committed Oct 6, 2023
1 parent b4cda26 commit ce7afd0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions registrar/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@
SESSION_EXPIRE_AT_BROWSER_CLOSE = False
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
CSRF_TRUSTED_ORIGINS = []
CSRF_TRUSTED_ORIGINS_WITH_SCHEMES = [] # temporary setting for Django 4.2 support
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
Expand Down
4 changes: 4 additions & 0 deletions registrar/settings/production.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from os import environ
import django
import yaml

from registrar.settings.base import *
Expand Down Expand Up @@ -53,3 +54,6 @@
CELERY_BROKER_HOSTNAME,
CELERY_BROKER_VHOST
)

if django.VERSION[0] >= 4: # for greater than django 3.2 use schemes.
CSRF_TRUSTED_ORIGINS = CSRF_TRUSTED_ORIGINS_WITH_SCHEMES

0 comments on commit ce7afd0

Please sign in to comment.