Skip to content

Commit 3e8d2e3

Browse files
committed
Fix testapp's include of admin.site.urls to be compatible with Django 2
1 parent d0d171a commit 3e8d2e3

File tree

1 file changed

+7
-1
lines changed
  • django_prometheus/tests/end2end/testapp

1 file changed

+7
-1
lines changed

django_prometheus/tests/end2end/testapp/urls.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1+
import django
12
from django.conf.urls import include, url
23
from django.contrib import admin
34
from testapp import views
45

6+
if django.VERSION >= (1, 9, 0):
7+
admin_urls = admin.site.urls
8+
else:
9+
admin_urls = include(admin.site.urls)
10+
511
urlpatterns = [
612
url(r'^$', views.index),
713
url(r'^help$', views.help),
@@ -11,5 +17,5 @@
1117
url(r'^newlawn/(?P<location>[a-zA-Z0-9 ]+)$', views.newlawn),
1218
url(r'^file$', views.file),
1319
url('', include('django_prometheus.urls')),
14-
url(r'^admin/', include(admin.site.urls)),
20+
url(r'^admin/', admin_urls),
1521
]

0 commit comments

Comments
 (0)