Skip to content

Commit b503060

Browse files
committed
Django 4.0 dropped django.conf.urls.url
1 parent 391a5fa commit b503060

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55

66
# Define URLs here so we can use ROOT_URLCONF="tests"
77

8-
from django.conf.urls import url
8+
try:
9+
from django.urls import re_path
10+
except ImportError:
11+
from django.conf.urls import url as re_path
912

1013

1114
def index(request):
@@ -14,5 +17,5 @@ def index(request):
1417

1518

1619
urlpatterns = [
17-
url(r'^home$', index, name='index'),
20+
re_path(r'^home$', index, name='index'),
1821
]

0 commit comments

Comments
 (0)