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

Commit

Permalink
feat: add csrf_trusted_origins_with_scheme setting
Browse files Browse the repository at this point in the history
  • Loading branch information
UsamaSadiq committed Oct 3, 2023
1 parent 574ef9c commit ff0c49c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions analytics_dashboard/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions analytics_dashboard/settings/production.py
Original file line number Diff line number Diff line change
@@ -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 *
Expand Down Expand Up @@ -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

0 comments on commit ff0c49c

Please sign in to comment.