2018-12-08 06:52:28 +08:00
|
|
|
from django.urls import include, path, re_path
|
2011-10-14 05:34:56 +08:00
|
|
|
|
2015-12-23 05:10:52 +08:00
|
|
|
from .utils import URLObject
|
2015-08-17 22:45:00 +08:00
|
|
|
from .views import empty_view, view_class_instance
|
2011-10-14 05:34:56 +08:00
|
|
|
|
2009-07-17 00:16:13 +08:00
|
|
|
testobj3 = URLObject("testapp", "test-ns3")
|
2015-06-03 23:11:08 +08:00
|
|
|
testobj4 = URLObject("testapp", "test-ns4")
|
2009-07-17 00:16:13 +08:00
|
|
|
|
2017-01-10 22:57:49 +08:00
|
|
|
app_name = "included_namespace_urls"
|
2015-08-17 22:45:00 +08:00
|
|
|
urlpatterns = [
|
2018-12-08 06:52:28 +08:00
|
|
|
path("normal/", empty_view, name="inc-normal-view"),
|
|
|
|
re_path(
|
|
|
|
"^normal/(?P<arg1>[0-9]+)/(?P<arg2>[0-9]+)/$",
|
|
|
|
empty_view,
|
|
|
|
name="inc-normal-view",
|
|
|
|
),
|
|
|
|
re_path(r"^\+\\\$\*/$", empty_view, name="inc-special-view"),
|
|
|
|
re_path(
|
|
|
|
"^mixed_args/([0-9]+)/(?P<arg2>[0-9]+)/$", empty_view, name="inc-mixed-args"
|
|
|
|
),
|
|
|
|
re_path("^no_kwargs/([0-9]+)/([0-9]+)/$", empty_view, name="inc-no-kwargs"),
|
|
|
|
re_path(
|
|
|
|
"^view_class/(?P<arg1>[0-9]+)/(?P<arg2>[0-9]+)/$",
|
|
|
|
view_class_instance,
|
|
|
|
name="inc-view-class",
|
|
|
|
),
|
|
|
|
path("test3/", include(*testobj3.urls)),
|
|
|
|
path("test4/", include(*testobj4.urls)),
|
|
|
|
path(
|
|
|
|
"ns-included3/",
|
|
|
|
include(
|
|
|
|
("urlpatterns_reverse.included_urls", "included_urls"), namespace="inc-ns3"
|
|
|
|
),
|
2022-02-04 03:24:19 +08:00
|
|
|
),
|
2018-12-08 06:52:28 +08:00
|
|
|
path(
|
|
|
|
"ns-included4/",
|
|
|
|
include("urlpatterns_reverse.namespace_urls", namespace="inc-ns4"),
|
2022-02-04 03:24:19 +08:00
|
|
|
),
|
2015-08-17 22:45:00 +08:00
|
|
|
]
|