liveBook · Manning

Debug toolbar panel

As explained in Django in Action

A Django Debug Toolbar panel is a configurable diagnostic component that displays a category of information about a request or view execution.

A Django Debug Toolbar panel is a configurable mini-report that displays one category of information about a request or view execution. Panels appear in the toolbar overlay and open to reveal detailed diagnostics. section 13.1

Panels answer different debugging questions:

  • The Time panel shows page-load timing, while the SQL panel reports database queries and their timing. section 13.1
  • Disable individual panels with their check marks when collecting their information affects performance, or add third-party panels when needed. section 13.1

Inspecting a musician listing

After configuring the toolbar for local development and visiting the musician-listing page, open the SQL panel. A paginated musicians view can show two queries: one counts all musicians, and another retrieves the limited page of results. The Time and SQL panels therefore help investigate a slow page, especially when ORM query complexity is not obvious. section 13.1

How Django in Action covers it

How deep it goes
Explains panel roles, configuration, opening and closing behavior, and SQL-based performance investigation.
Examples
Uses the musician listing, paginator-generated count and result queries, and the toolbar overlay.
What it assumes
Assumes a configured local Django project and requires adding 127.0.0.1 to INTERNAL_IPS.
What you can do after
Diagnose slow pages by inspecting timing data, SQL queries, request details, and related execution information.
How it connects
Connects panels with Django views, HTTP requests, templates, static files, database queries, ORM behavior, and pagination.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Django in Action. The section links point to the parts of the book it draws on.