Denis K 7 年之前
父節點
當前提交
feb5ddd049
共有 1 個文件被更改,包括 17 次插入6 次删除
  1. 17 6
      jet/tests/urls.py

+ 17 - 6
jet/tests/urls.py

@@ -4,12 +4,23 @@ from django.contrib import admin
 
 admin.autodiscover()
 
-urlpatterns = [
-    url(r'^jet/', include('jet.urls', 'jet')),
-    url(r'^jet/dashboard/', include('jet.dashboard.urls', 'jet-dashboard')),
-    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
-    url(r'^admin/', include(admin.site.urls)),
-]
+
+try:
+    from django.urls import path
+
+    urlpatterns = [
+        url(r'^jet/', include('jet.urls', 'jet')),
+        url(r'^jet/dashboard/', include('jet.dashboard.urls', 'jet-dashboard')),
+        url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
+        path('admin/', admin.site.urls),
+    ]
+except ImportError:  # Django < 2.0
+    urlpatterns = [
+        url(r'^jet/', include('jet.urls', 'jet')),
+        url(r'^jet/dashboard/', include('jet.dashboard.urls', 'jet-dashboard')),
+        url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
+        url(r'^admin/', include(admin.site.urls)),
+    ]
 
 if django.VERSION[:2] < (1, 8):
     from django.conf.urls import patterns