Skip to content

Commit c648dfb

Browse files
committed
Update pattern library urlpatterns for compatibility with Django 4.0
1 parent 2bc6faf commit c648dfb

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

pattern_library/urls.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
from django.conf.urls import url
1+
from django.urls import re_path
22

33
from pattern_library import get_pattern_template_suffix, views
44

55
app_name = 'pattern_library'
66
urlpatterns = [
77
# UI
8-
url(r'^$', views.IndexView.as_view(), name='index'),
9-
url(
8+
re_path(r'^$', views.IndexView.as_view(), name='index'),
9+
re_path(
1010
r'^pattern/(?P<pattern_template_name>[\w./-]+%s)$' % (
1111
get_pattern_template_suffix()
1212
),
@@ -15,7 +15,7 @@
1515
),
1616

1717
# iframe rendering
18-
url(
18+
re_path(
1919
r'^render-pattern/(?P<pattern_template_name>[\w./-]+%s)$' % (
2020
get_pattern_template_suffix()
2121
),

tests/urls.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
from django.conf import settings
2-
from django.conf.urls import include, url
2+
from django.urls import include, path
33

44
from pattern_library import urls as pattern_library_urls
55

66
if settings.GITHUB_PAGES_EXPORT:
77
urlpatterns = [
8-
url(r'^django-pattern-library/demo/pattern-library/', include(pattern_library_urls)),
8+
path('django-pattern-library/demo/pattern-library/', include(pattern_library_urls)),
99
]
1010
else:
1111
urlpatterns = [
12-
url(r'^pattern-library/', include(pattern_library_urls)),
12+
path('pattern-library/', include(pattern_library_urls)),
1313
]

0 commit comments

Comments
 (0)