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

feat: add csrf_trusted_origins_with_scheme setting #1507

Merged
merged 1 commit into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading