Add silk and django-debug-toolbar
Some checks failed
Deploy to Server / deploy (push) Failing after 5s
Some checks failed
Deploy to Server / deploy (push) Failing after 5s
This commit is contained in:
parent
232f1b7f66
commit
b112b69f52
1 changed files with 20 additions and 19 deletions
|
|
@ -1,23 +1,24 @@
|
|||
"""URL configuration for config project.
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
The `urlpatterns` list routes URLs to views. For more information please see:
|
||||
https://docs.djangoproject.com/en/6.0/topics/http/urls/
|
||||
|
||||
Examples:
|
||||
Function views
|
||||
1. Add an import: from my_app import views
|
||||
2. Add a URL to urlpatterns: path('', views.home, name='home')
|
||||
Class-based views
|
||||
1. Add an import: from other_app.views import Home
|
||||
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
|
||||
Including another URLconf
|
||||
1. Import the include() function: from django.urls import include, path
|
||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||
"""
|
||||
|
||||
from django.contrib import admin
|
||||
from django.conf import settings
|
||||
from django.conf.urls.static import static
|
||||
from django.urls import include
|
||||
from django.urls import path
|
||||
|
||||
urlpatterns = [
|
||||
path("admin/", admin.site.urls),
|
||||
if TYPE_CHECKING:
|
||||
from django.urls import URLPattern
|
||||
from django.urls.resolvers import URLResolver
|
||||
|
||||
urlpatterns: list[URLPattern | URLResolver] = [
|
||||
path(route="silk/", view=include("silk.urls", namespace="silk")),
|
||||
]
|
||||
if settings.DEBUG:
|
||||
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||
|
||||
if not settings.TESTING:
|
||||
from debug_toolbar.toolbar import ( # pyright: ignore[reportMissingTypeStubs]
|
||||
debug_toolbar_urls,
|
||||
)
|
||||
|
||||
urlpatterns += [path("silk/", include("silk.urls", namespace="silk"))]
|
||||
urlpatterns = [*urlpatterns, *debug_toolbar_urls()]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue