-
Notifications
You must be signed in to change notification settings - Fork 0
/
local_settings.py
42 lines (32 loc) · 1.1 KB
/
local_settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
"""Settings for Imperial Coldfront deployment.
MUST BE EXTENDED FOR PRODUCTION DEPLOYMENT.
"""
from coldfront.config.env import ENV
# -------------
# AUTH SETTINGS
# -------------
# required for mozilla-django-oidc to work
SESSION_COOKIE_SAMESITE = "Lax"
# if the basic OIDCAuthenticationBackend has been loaded by Coldfront then replace it
# with our customised version.
try:
AUTHENTICATION_BACKENDS.pop( # noqa:F821
AUTHENTICATION_BACKENDS.index( # noqa:F821
"mozilla_django_oidc.auth.OIDCAuthenticationBackend"
)
)
AUTHENTICATION_BACKENDS.append( # noqa:F821
"imperial_coldfront_plugin.oidc.ICLOIDCAuthenticationBackend"
)
except ValueError:
pass
# Enable loading of scopes from environment to be consistent with other OIDC
# settings. Coldfront explicitly enables the others but not this one.
OIDC_RP_SCOPES = ENV.str("OIDC_RP_SCOPES", default="")
# ----------------------
# MISCELLANEOUS SETTINGS
# ----------------------
TIME_ZONE = "Europe/London"
# enable our plugin
PLUGIN_ICL = True
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'