Skip to content

Commit df50fcb

Browse files
committed
Use new settings format for django-csp
fixes #40
1 parent a445258 commit df50fcb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

project_name/settings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import dj_database_url
1919
import sentry_sdk
20+
from csp.constants import SELF
2021
from sentry_sdk.integrations.django import DjangoIntegration
2122

2223
from .config import config
@@ -164,7 +165,7 @@
164165

165166
# CSP
166167
# https://django-csp.readthedocs.io/en/latest/configuration.html#configuration-chapter
167-
CSP_DEFAULT_SRC = ("'self'",)
168+
CONTENT_SECURITY_POLICY = {"DIRECTIVES": {"default-src": [SELF]}}
168169

169170
X_FRAME_OPTIONS = "DENY"
170171
REFERRER_POLICY = "same-origin"

0 commit comments

Comments
 (0)