Merge branch 'master' of https://github.com/ryanbagwell/django-cas-provider into...
[django-cas-provider.git] / cas_provider_examples / simple / urls.py
index 1d8eafa..62e735d 100644 (file)
@@ -1,10 +1,15 @@
-from django.conf.urls import patterns, include, url
+from __future__ import unicode_literals
+
+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')),
+]