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

Commit

Permalink
feat: add csrf_trusted_origins_with_scheme testing
Browse files Browse the repository at this point in the history
  • Loading branch information
UsamaSadiq committed Oct 3, 2023
1 parent 73e6964 commit f6eee03
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions analyticsdataserver/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,3 +471,8 @@
########## Django 3.2 upgrade settings
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
DEFAULT_HASHING_ALGORITHM = "sha1"


######### Django 4.2 CSRF_TRUSTED_ORIGINS settings
CSRF_TRUSTED_ORIGINS = []
CSRF_TRUSTED_ORIGINS_WITH_SCHEME = []
4 changes: 4 additions & 0 deletions analyticsdataserver/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from os import environ

import django
import six
import yaml
# Normally you should not import ANYTHING from Django directly
Expand Down Expand Up @@ -52,3 +53,6 @@ def get_env_setting(setting):

for override, value in DB_OVERRIDES.items():
DATABASES['default'][override] = value

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 f6eee03

Please sign in to comment.