| 1 |
from django.urls import include, path, re_path |
| 2 |
|
| 3 |
from . import views |
| 4 |
|
| 5 |
urlpatterns = [ |
| 6 |
path("articles/2003/", views.empty_view, name="articles-2003"), |
| 7 |
path("articles/<int:year>/", views.empty_view, name="articles-year"), |
| 8 |
path( |
| 9 |
"articles/<int:year>/<int:month>/", views.empty_view, name="articles-year-month" |
| 10 |
), |
| 11 |
path( |
| 12 |
"articles/<int:year>/<int:month>/<int:day>/", |
| 13 |
views.empty_view, |
| 14 |
name="articles-year-month-day", |
| 15 |
), |
| 16 |
path("books/2007/", views.empty_view, {"extra": True}, name="books-2007"), |
| 17 |
path( |
| 18 |
"books/<int:year>/<int:month>/<int:day>/", |
| 19 |
views.empty_view, |
| 20 |
{"extra": True}, |
| 21 |
name="books-year-month-day", |
| 22 |
), |
| 23 |
path("users/", views.empty_view, name="users"), |
| 24 |
path("users/<id>/", views.empty_view, name="user-with-id"), |
| 25 |
path("included_urls/", include("urlpatterns.included_urls")), |
| 26 |
re_path(r"^regex/(?P<pk>[0-9]+)/$", views.empty_view, name="regex"), |
| 27 |
re_path( |
| 28 |
r"^regex_optional/(?P<arg1>\d+)/(?:(?P<arg2>\d+)/)?", |
| 29 |
views.empty_view, |
| 30 |
name="regex_optional", |
| 31 |
), |
| 32 |
re_path( |
| 33 |
r"^regex_only_optional/(?:(?P<arg1>\d+)/)?", |
| 34 |
views.empty_view, |
| 35 |
name="regex_only_optional", |
| 36 |
), |
| 37 |
path("", include("urlpatterns.more_urls"), {"sub-extra": False}), |
| 38 |
path("<lang>/<path:url>/", views.empty_view, name="lang-and-path"), |
| 39 |
] |