From a39a73df9d6bf512e2c21969420df0b75b6ba985 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Fri, 9 Apr 2021 03:22:41 +0200 Subject: [PATCH] =?UTF-8?q?On=20r=C3=A9tablit=20authens=20et=20on=20passe?= =?UTF-8?q?=20=C3=A0=20Django=203.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- annuaire/settings/common.py | 13 +++++++++---- annuaire/settings/prod.py | 2 +- requirements.txt | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/annuaire/settings/common.py b/annuaire/settings/common.py index d0bfe3e..f402b64 100644 --- a/annuaire/settings/common.py +++ b/annuaire/settings/common.py @@ -5,6 +5,8 @@ Settings communs entre setups de dev et de production. import os import sys +from django.urls import reverse_lazy + # --- # Secrets # --- @@ -50,7 +52,7 @@ INSTALLED_APPS = [ "django.contrib.sessions", "django.contrib.messages", "django.contrib.staticfiles", - "django_cas_ng", + "authens", "fiches", ] @@ -84,11 +86,13 @@ TEMPLATES = [ AUTHENTICATION_BACKENDS = ( "django.contrib.auth.backends.ModelBackend", - "django_cas_ng.backends.CASBackend", + "fiches.backends.BackendFiches", ) WSGI_APPLICATION = "annuaire.wsgi.application" +DEFAULT_AUTO_FIELD = "django.db.models.AutoField" + # Internationalization # https://docs.djangoproject.com/en/dev/topics/i18n/ @@ -102,8 +106,9 @@ USE_TZ = True # Settings CAS # --- -CAS_SERVER_URL = "https://cas.eleves.ens.fr/" -CAS_VERSION = "2" +LOGIN_URL = reverse_lazy("authens:login") +LOGOUT_REDIRECT_URL = reverse_lazy("home") +AUTHENS_USE_OLDCAS = False # --- # LDAP et annuaire ENS diff --git a/annuaire/settings/prod.py b/annuaire/settings/prod.py index c5610a7..2a458cc 100644 --- a/annuaire/settings/prod.py +++ b/annuaire/settings/prod.py @@ -43,7 +43,7 @@ MEDIA_URL = "/media/" CACHES = { "default": { - "BACKEND": "redis_cache.RedisCache", + "BACKEND": "django_redis.cache.RedisCache", "LOCATION": "redis://:{passwd}@{host}:{port}/{db}".format( passwd=REDIS_PASSWD, host=REDIS_HOST, port=REDIS_PORT, db=REDIS_DB ), diff --git a/requirements.txt b/requirements.txt index 31e2a80..e2d516e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -django==2.2.* +django==3.2.* Pillow python-ldap authens