X-Git-Url: https://git.mdrn.pl/django-cas-provider.git/blobdiff_plain/02f62d8125f0fdc4e8610bd80d336859debe196b..b88bb747c08269f187d6073504c7dca3568112b9:/cas_provider_examples/simple/urls.py?ds=sidebyside diff --git a/cas_provider_examples/simple/urls.py b/cas_provider_examples/simple/urls.py index cf09e9b..d13d505 100644 --- a/cas_provider_examples/simple/urls.py +++ b/cas_provider_examples/simple/urls.py @@ -1,10 +1,13 @@ -from django.conf.urls import patterns, include, url +from django.conf.urls import include, url +from django.contrib import admin +from django.views.generic import TemplateView +from django import VERSION -import cas_provider -from django.views.generic.simple import redirect_to, direct_to_template +if VERSION >= (2,): + from django.urls import path -urlpatterns = patterns('', - url(r'^', include('cas_provider.urls')), - url(r'^accounts/profile', direct_to_template, {'template': 'login-success-redirect-target.html'}), - - ) +urlpatterns = [ + url(r'^admin/', include(admin.site.urls)) if VERSION < (2,) else path('admin/', admin.site.urls), + url(r'^', include('cas_provider.urls')), + url(r'^accounts/profile', TemplateView.as_view(template_name='login-success-redirect-target.html')), +]