Debian Codegraph @

tests/urlpatterns_reverse/included_urls2.py

raw
1 """
2 These URL patterns are included in two different ways in the main urls.py, with
3 an extra argument present in one case. Thus, there are two different ways for
4 each name to resolve and Django must distinguish the possibilities based on the
5 argument list.
6 """
7
8 from django.urls import re_path
9
10 from .views import empty_view
11
12 urlpatterns = [
13 re_path(r"^part/(?P<value>\w+)/$", empty_view, name="part"),
14 re_path(r"^part2/(?:(?P<value>\w+)/)?$", empty_view, name="part2"),
15 ]