File tree Expand file tree Collapse file tree 1 file changed +30
-1
lines changed
django/{{ cookiecutter.project_slug }}/{{ cookiecutter.project_slug }}/settings Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Original file line number Diff line number Diff line change 1515CORS_ALLOWED_ORIGIN_REGEXES = [
1616 r"^https://.*\.v2\.singular-it-test\.de$" ,
1717]
18- {% endif % }
18+ {% endif % }
19+
20+ # SECURITY
21+
22+ # https://docs.djangoproject.com/en/dev/ref/settings/#secure-proxy-ssl-header
23+ SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO" , "https" )
24+
25+ # https://docs.djangoproject.com/en/dev/ref/settings/#secure-ssl-redirect
26+ SECURE_SSL_REDIRECT = True
27+
28+ # https://docs.djangoproject.com/en/dev/ref/settings/#session-cookie-secure
29+ SESSION_COOKIE_SECURE = True
30+ SESSION_COOKIE_NAME = "{{ random_ascii_string(20) }}"
31+
32+ # https://docs.djangoproject.com/en/dev/ref/settings/#csrf-cookie-secure
33+ CSRF_COOKIE_SECURE = True
34+ CSRF_COOKIE_NAME = "{{ random_ascii_string(20) }}"
35+
36+ # https://docs.djangoproject.com/en/dev/topics/security/#ssl-https
37+ # https://docs.djangoproject.com/en/dev/ref/settings/#secure-hsts-seconds
38+ SECURE_HSTS_SECONDS = 60 * 60 * 24 * 7 # 1 week
39+
40+ # https://docs.djangoproject.com/en/dev/ref/settings/#secure-hsts-include-subdomains
41+ SECURE_HSTS_INCLUDE_SUBDOMAINS = True
42+
43+ # https://docs.djangoproject.com/en/dev/ref/settings/#secure-hsts-preload
44+ SECURE_HSTS_PRELOAD = True
45+
46+ # https://docs.djangoproject.com/en/dev/ref/middleware/#x-content-type-options-nosniff
47+ SECURE_CONTENT_TYPE_NOSNIFF = True
You can’t perform that action at this time.
0 commit comments