| 1 |
from django.urls import include, path, re_path |
| 2 |
|
| 3 |
from .utils import URLObject |
| 4 |
from .views import empty_view, view_class_instance |
| 5 |
|
| 6 |
testobj3 = URLObject("testapp", "test-ns3") |
| 7 |
testobj4 = URLObject("testapp", "test-ns4") |
| 8 |
|
| 9 |
app_name = "included_namespace_urls" |
| 10 |
urlpatterns = [ |
| 11 |
path("normal/", empty_view, name="inc-normal-view"), |
| 12 |
re_path( |
| 13 |
"^normal/(?P<arg1>[0-9]+)/(?P<arg2>[0-9]+)/$", |
| 14 |
empty_view, |
| 15 |
name="inc-normal-view", |
| 16 |
), |
| 17 |
re_path(r"^\+\\\$\*/$", empty_view, name="inc-special-view"), |
| 18 |
re_path( |
| 19 |
"^mixed_args/([0-9]+)/(?P<arg2>[0-9]+)/$", empty_view, name="inc-mixed-args" |
| 20 |
), |
| 21 |
re_path("^no_kwargs/([0-9]+)/([0-9]+)/$", empty_view, name="inc-no-kwargs"), |
| 22 |
re_path( |
| 23 |
"^view_class/(?P<arg1>[0-9]+)/(?P<arg2>[0-9]+)/$", |
| 24 |
view_class_instance, |
| 25 |
name="inc-view-class", |
| 26 |
), |
| 27 |
path("test3/", include(*testobj3.urls)), |
| 28 |
path("test4/", include(*testobj4.urls)), |
| 29 |
path( |
| 30 |
"ns-included3/", |
| 31 |
include( |
| 32 |
("urlpatterns_reverse.included_urls", "included_urls"), namespace="inc-ns3" |
| 33 |
), |
| 34 |
), |
| 35 |
path( |
| 36 |
"ns-included4/", |
| 37 |
include("urlpatterns_reverse.namespace_urls", namespace="inc-ns4"), |
| 38 |
), |
| 39 |
] |