An open API service indexing awesome lists of open source software.

https://github.com/eventbrite/django-debug-toolbar

A configurable set of panels that display various debug information about the current request/response.
https://github.com/eventbrite/django-debug-toolbar

Last synced: 3 months ago
JSON representation

A configurable set of panels that display various debug information about the current request/response.

Awesome Lists containing this project

README

        

====================
Django Debug Toolbar
====================

The Django Debug Toolbar is a configurable set of panels that display various
debug information about the current request/response and when clicked, display
more details about the panel's content.

Currently, the following panels have been written and are working:

- Django version
- Request timer
- A list of settings in settings.py
- Common HTTP headers
- GET/POST/cookie/session variable display
- Templates and context used, and their template paths
- SQL queries including time to execute and links to EXPLAIN each query
- List of signals, their args and receivers
- Logging output via Python's built-in logging, or via the `logbook `_ module

There is also one Django management command currently:

- `debugsqlshell`: Outputs the SQL that gets executed as you work in the Python
interactive shell. (See example below)

If you have ideas for other panels please let us know.

* Note: The Debug Toolbar only works on Django 1.1 and newer.

Installation
============

#. Add the `debug_toolbar` directory to your Python path.

#. Add the following middleware to your project's `settings.py` file:

``'debug_toolbar.middleware.DebugToolbarMiddleware',``

Tying into middleware allows each panel to be instantiated on request and
rendering to happen on response.

The order of MIDDLEWARE_CLASSES is important: the Debug Toolbar middleware
must come after any other middleware that encodes the response's content
(such as GZipMiddleware).

Note: The debug toolbar will only display itself if the mimetype of the
response is either `text/html` or `application/xhtml+xml` and contains a
closing `