Skip to content

Commit 86263a2

Browse files
committed
Fixes for Py2
1 parent 337e092 commit 86263a2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

django_webserver/tests/django_settings.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# print("sleeping...")
22
# import time; time.sleep(5)
33
from django.core.wsgi import get_wsgi_application
4-
from django.urls import path
4+
try:
5+
from django.urls import re_path as url
6+
except ImportError:
7+
from django.conf.urls import url
58

69
SECRET_KEY = "s"
710
WSGI_APPLICATION = "django_webserver.tests.django_settings.application"
@@ -17,7 +20,7 @@ def health(request):
1720
return HttpResponse("ok")
1821

1922

20-
urlpatterns = [path("-/health/", health)]
23+
urlpatterns = [url(r"^-/health/$", health)]
2124

2225

2326
application = get_wsgi_application()

0 commit comments

Comments
 (0)