Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added documentation around ProfilingPanel and problems with the middlwares #620

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 17 additions & 2 deletions docs/panels.rst
Expand Up @@ -105,19 +105,34 @@ 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
the ``DISABLE_PANELS`` configuration option.


Non-default built-in panels
---------------------------

The following panels are disabled by default. You must add them to the
``DEBUG_TOOLBAR_PANELS`` setting to enable them.

.. _profiling-panel:

Profiling
~~~~~~~~~

Path: ``debug_toolbar.panels.profiling.ProfilingPanel``

Profiling information for the view function.
Profiling information for the processing of the request.

If the ``debug_toolbar.middleware.DebugToolbarMiddleware`` is first in
``MIDDLEWARE_CLASSES`` then the other middlewares' ``process_view`` methods
will not be executed. This is because ``ProfilingPanel.process_view`` will
return a ``HttpResponse`` which causes the other middlewares'
``process_view`` methods to be skipped.

Note that the quick setup creates this situation, as it inserts
``DebugToolbarMiddleware`` first in ``MIDDLEWARE_CLASSES``.

If you run into this issues, then you should either disable the
``ProfilingPanel`` or move ``DebugToolbarMiddleware`` to the end of
``MIDDLEWARE_CLASSES``. If you do the latter, then the debug toolbar won't
track the execution of other middleware.

Third-party panels
------------------
Expand Down
11 changes: 11 additions & 0 deletions docs/tips.rst
Expand Up @@ -13,6 +13,17 @@ requests and return responses. Putting the debug toolbar middleware *after*
the Flatpage middleware, for example, means the toolbar will not show up on
flatpages.

Middleware isn't working correctly
----------------------------------

Using the Debug Toolbar in its default configuration and with the profiling
panel will cause middlewares after
``debug_toolbar.middleware.DebugToolbarMiddleware`` to not execute their
``process_view`` functions. This can be resolved by disabling the profiling
panel or moving the ``DebugToolbarMiddleware`` to the end of
``MIDDLEWARE_CLASSES``. Read more about it at
:ref:`ProfilingPanel <profiling-panel>`

Using the toolbar offline
-------------------------

Expand Down