Description
The issue here is that django-debug-toolbar
first executes process_response
method of every panel, then disables instrumentation, then runs generate_stats
. With Request history panel, generate_stats
is called when the former processes response, before instrumentation having been disabled.
As a part of generating stats Request panel records session data, which makes an SQL request. The request is recorded by SQL panel, since instrumentation has not yet been disabled. As a result in Debug toolbar I see "1 query in x ms." But when I open SQL panel I see no SQL queries. Supposedly because data for the panel are provided by Request history panel. And by the time Request History panel called generate_stats
on SQL panel, no extra queries were executed.