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

Commit

Permalink
Merge pull request #1507 from openedx/add-csrf-trusted-origins-with-s…
Browse files Browse the repository at this point in the history
…cheme

feat: add csrf_trusted_origins_with_scheme setting
  • Loading branch information
iamsobanjaved committed Oct 6, 2023
2 parents 574ef9c + ff0c49c commit 6c59317
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 6c59317

Please sign in to comment.