From 6d49074c135d1f5359cc34b69411ce932bf18f8d Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Sun, 29 Mar 2020 23:46:29 +0200 Subject: [PATCH 1/1] Migrate to django-cas-ng. --- requirements.txt | 2 +- src/audiobooks/settings.py | 7 ++++--- src/audiobooks/urls.py | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/requirements.txt b/requirements.txt index f2437f4..12bcbf9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ -i https://py.mdrn.pl:8443/simple django>=1.11,<2.0 -django-cas==2.1.1.1 +django-cas-ng==3.6.0 django-bootstrap4==0.0.7 celery[redis]==4.2 diff --git a/src/audiobooks/settings.py b/src/audiobooks/settings.py index d87cc00..eab421d 100644 --- a/src/audiobooks/settings.py +++ b/src/audiobooks/settings.py @@ -110,13 +110,13 @@ MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django_cas.middleware.CASMiddleware', + 'django_cas_ng.middleware.CASMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', ) AUTHENTICATION_BACKENDS = ( 'django.contrib.auth.backends.ModelBackend', - 'django_cas.backends.CASBackend', + 'django_cas_ng.backends.CASBackend', ) ROOT_URLCONF = 'audiobooks.urls' @@ -132,6 +132,7 @@ INSTALLED_APPS = ( # Uncomment the next line to enable admin documentation: # 'django.contrib.admindocs', 'bootstrap4', + 'django_cas_ng', 'apiclient', 'archive', @@ -167,7 +168,7 @@ LOGGING = { } CAS_SERVER_URL = "https://logowanie.nowoczesnapolska.org.pl/cas/" -CAS_VERSION = "1" +CAS_VERSION = "2" EMAIL_SUBJECT_PREFIX = '[Audio] ' SERVER_EMAIL = 'no-reply@audio.wolnelektury.pl' diff --git a/src/audiobooks/urls.py b/src/audiobooks/urls.py index eb198b0..b80ad2c 100644 --- a/src/audiobooks/urls.py +++ b/src/audiobooks/urls.py @@ -1,7 +1,7 @@ from django.conf import settings from django.conf.urls import include, url from django.views.generic import RedirectView -import django_cas.views +import django_cas_ng.views # Uncomment the next two lines to enable the admin: from django.contrib import admin @@ -13,6 +13,6 @@ urlpatterns = [ url(r'^publish/', include('apiclient.urls')), url(r'^admin/', include(admin.site.urls)), - url(r'^accounts/login/$', django_cas.views.login, name='login'), - url(r'^accounts/logout/$', django_cas.views.logout, name='logout'), + url(r'^accounts/login/$', django_cas_ng.views.LoginView.as_view(), name='login'), + url(r'^accounts/logout/$', django_cas_ng.views.LogoutView.as_view(), name='logout'), ] -- 2.20.1