Use authens in GestioBDS

This commit is contained in:
Martin Pépin 2020-07-30 12:04:04 +02:00
parent 9110e5b185
commit 3d830884b1
No known key found for this signature in database
GPG key ID: E7520278B1774448
3 changed files with 15 additions and 2 deletions

View file

@ -13,7 +13,7 @@ from .common import BASE_DIR, INSTALLED_APPS
ALLOWED_HOSTS = ["bds.ens.fr", "www.bds.ens.fr", "dev.cof.ens.fr"]
INSTALLED_APPS += ["bds", "events", "clubs"]
INSTALLED_APPS += ["bds", "events", "clubs", "authens"]
STATIC_ROOT = os.path.join(
os.path.dirname(os.path.dirname(BASE_DIR)), "public", "gestion", "static"
@ -28,5 +28,14 @@ MEDIA_URL = "/gestion/media/"
# Auth-related stuff
# ---
LOGIN_URL = "admin:login"
AUTHENTICATION_BACKENDS = [
"django.contrib.auth.backends.ModelBackend",
"authens.backends.ENSCASBackend",
"authens.backends.OldCASBackend",
]
AUTHENS_USE_OLDCAS = False
LOGIN_URL = "authens:login"
LOGIN_REDIRECT_URL = "bds:home"
LOGOUT_REDIRECT_URL = "bds:home"

View file

@ -144,6 +144,9 @@ if "events" in settings.INSTALLED_APPS:
# → rename this when the old events system is out
urlpatterns += [path("event_v2/", include("events.urls"))]
if "authens" in settings.INSTALLED_APPS:
urlpatterns.append(path("authens/", include("authens.urls")))
if "debug_toolbar" in settings.INSTALLED_APPS:
import debug_toolbar

View file

@ -17,3 +17,4 @@ wagtailmenus==3.*
wagtail-modeltranslation==0.10.*
django-cors-headers==2.2.0
django-js-reverse
authens==0.*