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-01-28 20:35:27 +08:00
|
|
|
|
from . import views
|
2007-02-13 12:24:58 +08:00
|
|
|
|
|
2015-06-26 00:49:50 +08:00
|
|
|
|
ns_patterns = [
|
2007-02-13 12:24:58 +08:00
|
|
|
|
# Test urls for testing reverse lookups
|
2018-12-08 06:52:28 +08:00
|
|
|
|
path("", views.index, name="index"),
|
|
|
|
|
re_path(r"^client/([0-9,]+)/$", views.client, name="client"),
|
|
|
|
|
re_path(
|
|
|
|
|
r"^client/(?P<id>[0-9]+)/(?P<action>[^/]+)/$",
|
|
|
|
|
views.client_action,
|
|
|
|
|
name="client_action",
|
|
|
|
|
),
|
|
|
|
|
re_path(
|
|
|
|
|
r"^client/(?P<client_id>[0-9]+)/(?P<action>[^/]+)/$",
|
|
|
|
|
views.client_action,
|
|
|
|
|
name="client_action",
|
2022-02-04 03:24:19 +08:00
|
|
|
|
),
|
2018-12-08 06:52:28 +08:00
|
|
|
|
re_path(r"^named-client/([0-9]+)/$", views.client2, name="named.client"),
|
2015-06-26 00:49:50 +08:00
|
|
|
|
]
|
|
|
|
|
|
2007-07-08 02:24:27 +08:00
|
|
|
|
|
2015-06-26 00:49:50 +08:00
|
|
|
|
urlpatterns = ns_patterns + [
|
2007-07-08 02:24:27 +08:00
|
|
|
|
# Unicode strings are permitted everywhere.
|
2018-12-08 06:52:28 +08:00
|
|
|
|
re_path(r"^Юникод/(\w+)/$", views.client2, name="метка_оператора"),
|
|
|
|
|
re_path(r"^Юникод/(?P<tag>\S+)/$", views.client2, name="метка_оператора_2"),
|
2015-06-26 00:49:50 +08:00
|
|
|
|
# Test urls for namespaces and current_app
|
2018-12-08 06:52:28 +08:00
|
|
|
|
path("ns1/", include((ns_patterns, "app"), "ns1")),
|
|
|
|
|
path("ns2/", include((ns_patterns, "app"))),
|
2014-04-02 08:46:34 +08:00
|
|
|
|
]
|