X-Git-Url: https://git.mdrn.pl/django-cas-provider.git/blobdiff_plain/82555c55f77395067231c1c22685597f12706902..413bf45b20e253acdf45c0e43d4f05b1ecf33c0d:/cas_provider_examples/simple/urls.py?ds=inline diff --git a/cas_provider_examples/simple/urls.py b/cas_provider_examples/simple/urls.py index c717237..62e735d 100644 --- a/cas_provider_examples/simple/urls.py +++ b/cas_provider_examples/simple/urls.py @@ -1,10 +1,15 @@ -from django.conf.urls.defaults import patterns, include, url +from __future__ import unicode_literals -import cas_provider -from django.views.generic.simple import redirect_to, direct_to_template +from django.conf.urls import include, url +from django.contrib import admin +from django.views.generic import TemplateView +from django import VERSION -urlpatterns = patterns('', - url(r'^', include('cas_provider.urls')), - url(r'^accounts/profile', direct_to_template, {'template': 'login-success-redirect-target.html'}), +if VERSION >= (2,): + from django.urls import path - ) +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')), +]