From: Radek Czajka Date: Mon, 4 May 2020 10:04:43 +0000 (+0200) Subject: Standardize CAS view names for django_cas_ng. X-Git-Url: https://git.mdrn.pl/audio.git/commitdiff_plain/2ac475876ab5e60527a4ab7b112bda36d1e98591 Standardize CAS view names for django_cas_ng. --- diff --git a/src/archive/templates/archive/base.html b/src/archive/templates/archive/base.html index 1382912..9eeaf8c 100644 --- a/src/archive/templates/archive/base.html +++ b/src/archive/templates/archive/base.html @@ -15,9 +15,9 @@ {% endif %} {% if user.is_authenticated %} - + {% else %} - + {% endif %} {% if user.is_staff %} diff --git a/src/archive/views.py b/src/archive/views.py index b39ac72..3da6bb4 100644 --- a/src/archive/views.py +++ b/src/archive/views.py @@ -4,7 +4,6 @@ import os.path from urllib.parse import quote from archive import settings -from django.contrib.auth import logout from django.contrib.auth.decorators import permission_required from django.urls import reverse from django.db.models import Q, Max diff --git a/src/audiobooks/urls.py b/src/audiobooks/urls.py index 792a50f..cd83905 100644 --- a/src/audiobooks/urls.py +++ b/src/audiobooks/urls.py @@ -1,19 +1,17 @@ -from django.conf import settings -from django.conf.urls import include, url +from django.contrib import admin +from django.urls import include, path from django.views.generic import RedirectView +from django.contrib import admin import django_cas_ng.views -# Uncomment the next two lines to enable the admin: -from django.contrib import admin -admin.autodiscover() urlpatterns = [ - url(r'^$', RedirectView.as_view(url='archive/', permanent=False)), - url(r'^archive/', include('archive.urls')), - url(r'^youtube/', include('youtube.urls')), - url(r'^publish/', include('apiclient.urls')), + path('', RedirectView.as_view(url='archive/', permanent=False)), + path('archive/', include('archive.urls')), + path('youtube/', include('youtube.urls')), + path('publish/', include('apiclient.urls')), - url(r'^admin/', admin.site.urls), - 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'), + path('admin/', admin.site.urls), + path('accounts/login/', django_cas_ng.views.LoginView.as_view(), name='cas_ng_login'), + path('accounts/logout/', django_cas_ng.views.LogoutView.as_view(), name='cas_ng_logout'), ]