X-Git-Url: https://git.mdrn.pl/django-cas-provider.git/blobdiff_plain/38e127a205b49ab137d554895d426cb8e7dcd785..122f2f5678cfe723a44c140206da2cb9117b46ee:/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 71e70f3..d13d505 100644 --- a/cas_provider_examples/simple/urls.py +++ b/cas_provider_examples/simple/urls.py @@ -1,12 +1,13 @@ -from __future__ import unicode_literals - -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 -urlpatterns = patterns('', - url(r'^admin/', include(admin.site.urls)), - url(r'^', include('cas_provider.urls')), - url(r'^accounts/profile', TemplateView.as_view(template_name='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')), +]