Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ If you're upgrading from a previous version, you should review the
Setting up URLconf
------------------

Add the Debug Toolbar's URLs to your project's URLconf as follows::
Add the Debug Toolbar's URLs to your project's URLconf::

import debug_toolbar
from django.conf import settings
from django.urls import include, path

if settings.DEBUG:
import debug_toolbar
urlpatterns = [
path('__debug__/', include(debug_toolbar.urls)),
] + urlpatterns
urlpatterns = [
...
path('__debug__/', include(debug_toolbar.urls)),
]

This example uses the ``__debug__`` prefix, but you can use any prefix that
doesn't clash with your application's URLs. Note the lack of quotes around
Expand Down
9 changes: 3 additions & 6 deletions example/urls.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
from django.conf import settings
from django.contrib import admin
from django.urls import include, path
from django.views.generic import TemplateView

import debug_toolbar

urlpatterns = [
path("", TemplateView.as_view(template_name="index.html")),
path("jquery/", TemplateView.as_view(template_name="jquery/index.html")),
path("mootools/", TemplateView.as_view(template_name="mootools/index.html")),
path("prototype/", TemplateView.as_view(template_name="prototype/index.html")),
path("admin/", admin.site.urls),
path("__debug__/", include(debug_toolbar.urls)),
]

if settings.DEBUG:
import debug_toolbar

urlpatterns += [path("__debug__/", include(debug_toolbar.urls))]