The Django Debug Toolbar ships with a series of built-in panels. In addition, several third-party panels are available.
Default built-in panels¶
The following panels are enabled by default.
This panel shows the history of requests made and allows switching to a past snapshot of the toolbar to view that request’s stats.
Shows versions of Python, Django, and installed apps if possible.
This panels shows the HTTP request and response headers, as well as a selection of values from the WSGI environment.
Note that headers set by middleware placed before the debug toolbar middleware
MIDDLEWARE won’t be visible in the panel. The WSGI server itself may
also add response headers such as
SQL queries including time to execute and links to EXPLAIN each query.
Templates and context used, and their template paths.
Used static files and their locations (via the
Cache queries. Is incompatible with Django’s per-site caching.
Logging output via Python’s built-in
When this panel is enabled, the debug toolbar will show an intermediate page upon redirect so you can view any debug information prior to redirecting. This page will provide a link to the redirect destination you can follow when ready.
Since this behavior is annoying when you aren’t debugging a redirect, this
panel is included but inactive by default. You can activate it by default with
DISABLE_PANELS configuration option.
Third-party panels aren’t officially supported!
The authors of the Django Debug Toolbar maintain a list of third-party panels, but they can’t vouch for the quality of each of them. Please report bugs to their authors.
If you’d like to add a panel to this list, please submit a pull request!
Generates a flame graph from your current request.
See queries made by your Haystack backends.
HTML Tidy or HTML Validator is a custom panel that validates your HTML and displays warnings and errors.
Retrieves and displays information you specify using the
Inspector panel also logs to the console by default, but may be instructed not
LDAP Operations performed during the request, including timing, request and response messages, the entries received, write changes list, stack-tracing and error debugging. This panel also shows connection usage metrics when it is collected. Check out the docs.
This package provides a profiling panel that incorporates output from line_profiler.
This panel captures and displays emails sent from your application.
This panel tracks memcached usage. It currently supports both the pylibmc and memcache libraries.
Adds MongoDB debugging information.
Trace neo4j rest API calls in your Django application, this also works for neo4django and neo4jrestclient, support for py2neo is on its way.
Shows process memory information (virtual size, resident set size) and model instances for the current request.
Switch between requests to view their stats. Also adds support for viewing stats for AJAX requests.
Lists HTTP requests made with the popular requests library.
Browse Sites registered in
django.contrib.sites and switch between them.
Useful to debug project when you use django-dynamicsites which sets SITE_ID
Shows template render call duration and distribution on the timeline. Lightweight. Compatible with WSGI servers which reuse threads for multiple requests (Werkzeug).
Displays template rendering times for your Django application.
Easily switch between logged in users, see properties of current user.
Displays VCS status (revision, branch, latest commit log and more) of your Django application.
API for third-party panels¶
Third-party panels must subclass
according to the public API described below. Unless noted otherwise, all
methods are optional.
Panels can ship their own templates, static files and views. All views should
be decorated with
debug_toolbar.decorators.require_show_toolbar to prevent
unauthorized access. There is no public CSS API at this time.
Base class for panels.
Title shown in the side bar. Defaults to
Subtitle shown in the side bar. Defaults to the empty string.
Trueif the panel can be displayed in full screen,
Falseif it’s only shown in the side bar. Defaults to
Title shown in the panel when it’s displayed in full screen.
Mandatory, unless the panel sets
Template used to render
Mandatory, unless the panel sets
Falseor overrides attr:content`.
Content of the panel when it’s displayed in full screen.
Scripts used by the HTML content of the panel when it’s displayed.
Return URLpatterns, if the panel has its own views.
Enable instrumentation to gather data for this panel.
This usually means monkey-patching (!) or registering signal receivers. Any instrumentation with a non-negligible effect on performance should be installed by this method rather than at import time.
Unless the toolbar or this panel is disabled, this method will be called early in
DebugToolbarMiddleware. It should be idempotent.
Disable instrumentation to gather data for this panel.
This is the opposite of
Unless the toolbar or this panel is disabled, this method will be called late in the middleware. It should be idempotent.
Store data gathered by the panel.
Each call to
record_statsupdates the statistics dictionary.
Like __call__ in Django’s middleware.
Write panel logic related to the request there. Save data with
Return the existing response or overwrite it.
process_request, but may not be executed on every request. This will only be called if the toolbar will be inserted into the request.
Write panel logic related to the response there. Post-process data gathered while the view executed. Save data with
Does not return a value.
Check that the integration is configured correctly for the panel.
This will be called as a part of the Django checks system when the application is being setup.
Return a list of :class: django.core.checks.CheckMessage instances.
Closes the topmost level (window/panel/toolbar)
This is a helper function to fetch values stored in the cookies.
key – The key for the value to be fetched.
This is a helper function to set a value stored in the cookies.
key – The key to be used.
value – The value to be set.
options – The options for the value to be set. It should contain the properties
Closes any panels and hides the toolbar.
Shows the toolbar.