|
1 | 1 | from django.contrib.auth.views import LoginView
|
| 2 | +from django.urls import path |
2 | 3 | from django.urls import include, re_path
|
3 | 4 | from . import views
|
4 | 5 |
|
5 | 6 | urlpatterns = [
|
6 | 7 | # LoginRequiredMixin tests
|
7 |
| - re_path(r"^login_required/$", views.LoginRequiredView.as_view()), |
| 8 | + path("login_required/", views.LoginRequiredView.as_view()), |
8 | 9 | # AnonymousRequiredView tests
|
9 |
| - re_path( |
10 |
| - r"^unauthenticated_view/$", |
| 10 | + path( |
| 11 | + "unauthenticated_view/", |
11 | 12 | views.AnonymousRequiredView.as_view(),
|
12 | 13 | name="unauthenticated_view",
|
13 | 14 | ),
|
14 |
| - re_path( |
15 |
| - r"^authenticated_view/$", |
| 15 | + path( |
| 16 | + "authenticated_view/", |
16 | 17 | views.AuthenticatedView.as_view(),
|
17 | 18 | name="authenticated_view",
|
18 | 19 | ),
|
19 | 20 | # AjaxResponseMixin tests
|
20 |
| - re_path(r"^ajax_response/$", views.AjaxResponseView.as_view()), |
| 21 | + path("ajax_response/", views.AjaxResponseView.as_view()), |
21 | 22 | # CreateAndRedirectToEditView tests
|
22 |
| - re_path(r"^article/create/$", views.CreateArticleView.as_view()), |
23 |
| - re_path( |
24 |
| - r"^article/(?P<pk>\d+)/edit/$", |
| 23 | + path("article/create/", views.CreateArticleView.as_view()), |
| 24 | + path( |
| 25 | + "article/<int:pk>/edit/", |
25 | 26 | views.EditArticleView.as_view(),
|
26 | 27 | name="edit_article",
|
27 | 28 | ),
|
28 |
| - re_path( |
29 |
| - r"^article_list/create/$", |
| 29 | + path( |
| 30 | + "article_list/create/", |
30 | 31 | views.CreateArticleAndRedirectToListView.as_view(),
|
31 | 32 | ),
|
32 |
| - re_path( |
33 |
| - r"^article_list_bad/create/$", |
| 33 | + path( |
| 34 | + "article_list_bad/create/", |
34 | 35 | views.CreateArticleAndRedirectToListViewBad.as_view(),
|
35 | 36 | ),
|
36 |
| - re_path( |
37 |
| - r"^article_list/$", |
| 37 | + path( |
| 38 | + "article_list/", |
38 | 39 | views.ArticleListView.as_view(),
|
39 | 40 | name="article_list",
|
40 | 41 | ),
|
|
60 | 61 | name="canonical_model",
|
61 | 62 | ),
|
62 | 63 | # UserFormKwargsMixin tests
|
63 |
| - re_path(r"^form_with_user_kwarg/$", views.FormWithUserKwargView.as_view()), |
| 64 | + path("form_with_user_kwarg/", views.FormWithUserKwargView.as_view()), |
64 | 65 | # SetHeadlineMixin tests
|
65 |
| - re_path(r"^headline/$", views.HeadlineView.as_view(), name="headline"), |
66 |
| - re_path(r"^headline/lazy/$", views.LazyHeadlineView.as_view()), |
| 66 | + path("headline/", views.HeadlineView.as_view(), name="headline"), |
| 67 | + path("headline/lazy/", views.LazyHeadlineView.as_view()), |
67 | 68 | re_path(r"^headline/(?P<s>[\w-]+)/$", views.DynamicHeadlineView.as_view()),
|
68 | 69 | # ExtraContextMixin tests
|
69 |
| - re_path(r"^context/$", views.ContextView.as_view(), name="context"), |
| 70 | + path("context/", views.ContextView.as_view(), name="context"), |
70 | 71 | # PermissionRequiredMixin tests
|
71 |
| - re_path(r"^permission_required/$", views.PermissionRequiredView.as_view()), |
| 72 | + path("permission_required/", views.PermissionRequiredView.as_view()), |
72 | 73 | # MultiplePermissionsRequiredMixin tests
|
73 |
| - re_path( |
74 |
| - r"^multiple_permissions_required/$", |
| 74 | + path( |
| 75 | + "multiple_permissions_required/", |
75 | 76 | views.MultiplePermissionsRequiredView.as_view(),
|
76 | 77 | ),
|
77 | 78 | # SuperuserRequiredMixin tests
|
78 |
| - re_path(r"^superuser_required/$", views.SuperuserRequiredView.as_view()), |
| 79 | + path("superuser_required/", views.SuperuserRequiredView.as_view()), |
79 | 80 | # StaffuserRequiredMixin tests
|
80 |
| - re_path(r"^staffuser_required/$", views.StaffuserRequiredView.as_view()), |
| 81 | + path("staffuser_required/", views.StaffuserRequiredView.as_view()), |
81 | 82 | # GroupRequiredMixin tests
|
82 |
| - re_path(r"^group_required/$", views.GroupRequiredView.as_view()), |
| 83 | + path("group_required/", views.GroupRequiredView.as_view()), |
83 | 84 | # UserPassesTestMixin tests
|
84 |
| - re_path(r"^user_passes_test/$", views.UserPassesTestView.as_view()), |
| 85 | + path("user_passes_test/", views.UserPassesTestView.as_view()), |
85 | 86 | # UserPassesTestMixin tests
|
86 |
| - re_path( |
87 |
| - r"^user_passes_test_not_implemented/$", |
| 87 | + path( |
| 88 | + "user_passes_test_not_implemented/", |
88 | 89 | views.UserPassesTestNotImplementedView.as_view(),
|
89 | 90 | ),
|
90 | 91 | # CsrfExemptMixin tests
|
91 |
| - re_path(r"^csrf_exempt/$", views.CsrfExemptView.as_view()), |
| 92 | + path("csrf_exempt/", views.CsrfExemptView.as_view()), |
92 | 93 | # JSONResponseMixin tests
|
93 |
| - re_path(r"^simple_json/$", views.SimpleJsonView.as_view()), |
94 |
| - re_path( |
95 |
| - r"^simple_json_custom_encoder/$", views.CustomJsonEncoderView.as_view() |
| 94 | + path("simple_json/", views.SimpleJsonView.as_view()), |
| 95 | + path( |
| 96 | + "simple_json_custom_encoder/", views.CustomJsonEncoderView.as_view() |
96 | 97 | ),
|
97 |
| - re_path(r"^simple_json_400/$", views.SimpleJsonBadRequestView.as_view()), |
98 |
| - re_path(r"^article_list_json/$", views.ArticleListJsonView.as_view()), |
| 98 | + path("simple_json_400/", views.SimpleJsonBadRequestView.as_view()), |
| 99 | + path("article_list_json/", views.ArticleListJsonView.as_view()), |
99 | 100 | # JsonRequestResponseMixin tests
|
100 |
| - re_path(r"^json_request/$", views.JsonRequestResponseView.as_view()), |
101 |
| - re_path(r"^json_bad_request/$", views.JsonBadRequestView.as_view()), |
102 |
| - re_path( |
103 |
| - r"^json_custom_bad_request/$", views.JsonCustomBadRequestView.as_view() |
| 101 | + path("json_request/", views.JsonRequestResponseView.as_view()), |
| 102 | + path("json_bad_request/", views.JsonBadRequestView.as_view()), |
| 103 | + path( |
| 104 | + "json_custom_bad_request/", views.JsonCustomBadRequestView.as_view() |
104 | 105 | ),
|
105 | 106 | # FormMessagesMixin tests
|
106 |
| - re_path(r"form_messages/$", views.FormMessagesView.as_view()), |
| 107 | + path("form_messages/", views.FormMessagesView.as_view()), |
107 | 108 | # AllVerbsMixin tests
|
108 |
| - re_path(r"all_verbs/$", views.AllVerbsView.as_view()), |
109 |
| - re_path( |
110 |
| - r"all_verbs_no_handler/$", views.AllVerbsView.as_view(all_handler=None) |
| 109 | + path("all_verbs/", views.AllVerbsView.as_view()), |
| 110 | + path( |
| 111 | + "all_verbs_no_handler/", views.AllVerbsView.as_view(all_handler=None) |
111 | 112 | ),
|
112 | 113 | # SSLRequiredMixin tests
|
113 |
| - re_path(r"^sslrequired/$", views.SSLRequiredView.as_view()), |
| 114 | + path("sslrequired/", views.SSLRequiredView.as_view()), |
114 | 115 | # RecentLoginRequiredMixin tests
|
115 |
| - re_path(r"^recent_login/$", views.RecentLoginRequiredView.as_view()), |
116 |
| - re_path(r"^outdated_login/$", views.RecentLoginRequiredView.as_view()), |
| 116 | + path("recent_login/", views.RecentLoginRequiredView.as_view()), |
| 117 | + path("outdated_login/", views.RecentLoginRequiredView.as_view()), |
117 | 118 | # HeaderMixin tests
|
118 |
| - re_path(r'^headers/attribute/$', views.AttributeHeaderView.as_view()), |
119 |
| - re_path(r'^headers/method/$', views.MethodHeaderView.as_view()), |
120 |
| - re_path(r'^headers/existing/$', views.ExistingHeaderView.as_view()), |
| 119 | + path('headers/attribute/', views.AttributeHeaderView.as_view()), |
| 120 | + path('headers/method/', views.MethodHeaderView.as_view()), |
| 121 | + path('headers/existing/', views.ExistingHeaderView.as_view()), |
121 | 122 | # CacheControlMixin tests
|
122 |
| - re_path(r'^cachecontrol/public/$', views.CacheControlPublicView.as_view()), |
| 123 | + path('cachecontrol/public/', views.CacheControlPublicView.as_view()), |
123 | 124 | # NeverCacheMixin tests
|
124 |
| - re_path(r'^nevercache/$', views.NeverCacheView.as_view()), |
| 125 | + path('nevercache/', views.NeverCacheView.as_view()), |
125 | 126 | ]
|
126 | 127 |
|
127 | 128 | urlpatterns += [
|
128 |
| - re_path( |
129 |
| - r"^accounts/login/$", LoginView.as_view(template_name="blank.html") |
| 129 | + path( |
| 130 | + "accounts/login/", LoginView.as_view(template_name="blank.html") |
130 | 131 | ),
|
131 |
| - re_path(r"^auth/login/$", LoginView.as_view(template_name="blank.html")), |
| 132 | + path("auth/login/", LoginView.as_view(template_name="blank.html")), |
132 | 133 | ]
|
133 | 134 |
|
134 | 135 | urlpatterns += [
|
135 |
| - re_path( |
136 |
| - r"^article-canonical-namespaced/", |
| 136 | + path( |
| 137 | + "article-canonical-namespaced/", |
137 | 138 | include(
|
138 | 139 | ("tests.urls_namespaced", "tests"), namespace="some_namespace"
|
139 | 140 | ),
|
|
0 commit comments