diff --git a/analytics_dashboard/settings/base.py b/analytics_dashboard/settings/base.py index 523a9f1c5..ebb067719 100644 --- a/analytics_dashboard/settings/base.py +++ b/analytics_dashboard/settings/base.py @@ -515,3 +515,6 @@ # See https://openedx.atlassian.net/wiki/spaces/AC/pages/3066626061/Django+3.2+Upgrade+Key+Changes DEFAULT_AUTO_FIELD = 'django.db.models.AutoField' DEFAULT_HASHING_ALGORITHM = 'sha1' + +CSRF_TRUSTED_ORIGINS = [] +CSRF_TRUSTED_ORIGINS_WITH_SCHEME = [] # temporary setting for Django 4.2 support diff --git a/analytics_dashboard/settings/production.py b/analytics_dashboard/settings/production.py index 523fa8fce..fad1c6713 100644 --- a/analytics_dashboard/settings/production.py +++ b/analytics_dashboard/settings/production.py @@ -1,5 +1,7 @@ """Production settings and globals.""" +import django + from analytics_dashboard.settings.base import * from analytics_dashboard.settings.logger import get_logger_config from analytics_dashboard.settings.yaml_config import * @@ -36,3 +38,6 @@ # Use Cloudfront CDN for assets if CDN_DOMAIN: STATIC_URL = 'https://' + CDN_DOMAIN + '/static/' + +if django.VERSION[0] >= 4: # for greater than django 3.2 use schemes. + CSRF_TRUSTED_ORIGINS = CSRF_TRUSTED_ORIGINS_WITH_SCHEME