2021-01-12 21:37:56 +08:00
|
|
|
from django.http import HttpResponse
|
2018-12-08 06:52:28 +08:00
|
|
|
from django.urls import include, path
|
2011-10-14 02:51:33 +08:00
|
|
|
|
2015-01-28 20:35:27 +08:00
|
|
|
from . import admin, custom_has_permission_admin, customadmin, views
|
2017-12-02 03:43:40 +08:00
|
|
|
from .test_autocomplete_view import site as autocomplete_site
|
2008-07-19 07:54:34 +08:00
|
|
|
|
2021-01-12 21:37:56 +08:00
|
|
|
|
|
|
|
def non_admin_view(request):
|
|
|
|
return HttpResponse()
|
|
|
|
|
|
|
|
|
2014-04-02 08:46:34 +08:00
|
|
|
urlpatterns = [
|
2018-12-08 06:52:28 +08:00
|
|
|
path("test_admin/admin/doc/", include("django.contrib.admindocs.urls")),
|
|
|
|
path("test_admin/admin/secure-view/", views.secure_view, name="secure_view"),
|
|
|
|
path("test_admin/admin/secure-view2/", views.secure_view2, name="secure_view2"),
|
|
|
|
path("test_admin/admin/", admin.site.urls),
|
|
|
|
path("test_admin/admin2/", customadmin.site.urls),
|
|
|
|
path(
|
|
|
|
"test_admin/admin3/",
|
|
|
|
(admin.site.get_urls(), "admin", "admin3"),
|
|
|
|
{"form_url": "pony"},
|
|
|
|
),
|
|
|
|
path("test_admin/admin4/", customadmin.simple_site.urls),
|
|
|
|
path("test_admin/admin5/", admin.site2.urls),
|
|
|
|
path("test_admin/admin6/", admin.site6.urls),
|
|
|
|
path("test_admin/admin7/", admin.site7.urls),
|
2016-06-19 18:51:58 +08:00
|
|
|
# All admin views accept `extra_context` to allow adding it like this:
|
2018-12-08 06:52:28 +08:00
|
|
|
path(
|
|
|
|
"test_admin/admin8/",
|
|
|
|
(admin.site.get_urls(), "admin", "admin-extra-context"),
|
|
|
|
{"extra_context": {}},
|
|
|
|
),
|
|
|
|
path("test_admin/admin9/", admin.site9.urls),
|
2021-01-12 21:37:56 +08:00
|
|
|
path("test_admin/admin10/", admin.site10.urls),
|
2018-12-08 06:52:28 +08:00
|
|
|
path("test_admin/has_permission_admin/", custom_has_permission_admin.site.urls),
|
|
|
|
path("test_admin/autocomplete_admin/", autocomplete_site.urls),
|
2021-01-12 21:37:56 +08:00
|
|
|
# Shares the admin URL prefix.
|
|
|
|
path("test_admin/admin/non_admin_view/", non_admin_view, name="non_admin"),
|
|
|
|
path("test_admin/admin10/non_admin_view/", non_admin_view, name="non_admin10"),
|
2014-04-02 08:46:34 +08:00
|
|
|
]
|