Migrate to django-cas-ng.
authorRadek Czajka <rczajka@rczajka.pl>
Sun, 29 Mar 2020 21:46:29 +0000 (23:46 +0200)
committerRadek Czajka <rczajka@rczajka.pl>
Sun, 29 Mar 2020 21:46:29 +0000 (23:46 +0200)
requirements.txt
src/audiobooks/settings.py
src/audiobooks/urls.py

index f2437f4..12bcbf9 100644 (file)
@@ -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
index d87cc00..eab421d 100644 (file)
@@ -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'
index eb198b0..b80ad2c 100644 (file)
@@ -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'),
 ]