X-Git-Url: https://git.mdrn.pl/audio.git/blobdiff_plain/eee35e00bf0d0eb3d2a9f08f72c7052962fecbf6..3c7adf8af63a913089eb5ec736443ea0c59a8d68:/src/audiobooks/urls.py?ds=sidebyside diff --git a/src/audiobooks/urls.py b/src/audiobooks/urls.py index f3113c8..cd83905 100644 --- a/src/audiobooks/urls.py +++ b/src/audiobooks/urls.py @@ -1,21 +1,17 @@ -from django.conf import settings -from django.conf.urls import patterns, include, url +from django.contrib import admin +from django.urls import include, path from django.views.generic import RedirectView - -# Uncomment the next two lines to enable the admin: from django.contrib import admin -admin.autodiscover() +import django_cas_ng.views -urlpatterns = patterns('', - url(r'^$', RedirectView.as_view(url='archive/')), - url(r'^archive/', include('archive.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'), -) +urlpatterns = [ + path('', RedirectView.as_view(url='archive/', permanent=False)), + path('archive/', include('archive.urls')), + path('youtube/', include('youtube.urls')), + path('publish/', include('apiclient.urls')), -if settings.DEBUG: - urlpatterns += patterns('', - (r'^media/(?P.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT, 'show_indexes':True}), -) + 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'), +]