Django: Getting Started Transcripts
Chapter: 3rd Party Libraries for Django
Lecture: Using the Debug Toolbar

Login or purchase this course to watch this video and the rest of the course contents.
0:00 You can see the toolbar has been installed as it shows up as a semi transparent overlay in the corner here. Let me click it open.
0:10 That's a long list, isn't it? Note the check boxes here for performance reasons.
0:14 You might want to turn some of these off which you can do by clicking one of these boxes. As the homepage doesn't have much on it,
0:22 let me click through to the author's list. Now, let's go through some of the debug info. Each of the categories in the toolbar are clickable,
0:32 clicking it opens a details panel. I'll start with history. This shows all the places I've been along with the request variables and response code.
0:43 I can close a panel with the X in the top corner. If I click time, I see all sorts of information about how long the page took,
0:54 including how many context switches and a graph of where the page spend its time.
1:04 Settings shows all the configuration in setting.py as well as the other bits of configuration Django is added after it loaded your conflict file.
1:16 Headers shows all the http headers in both the request and the response as well as the underlying environment for WSGI.
1:27 The request panel shows details about the request, including what arguments there were, none in this case and what cookies were set.
1:38 SQL shows the queries run for this page. In a startling amount of detail including the amount of time it took to run the query.
1:47 If your pages are running slow. This is a quick way to see whether it's the page itself or the query underneath that's causing the problem.
1:55 Static files shows info about what files are fed from static It is even differentiating those files that are directly in the template versus those that
2:06 are inherited into the template. And the last one I'll show you is the templates panel.
2:14 This gives you info on the template being rendered what it inherits from and what context processors contributed to it.
2:23 If I click the CSRF context processor, you can even see what object got pulled in by it. Are magic CSRF token.
2:32 The debug toolbar is invaluable when you're hunting down problems and the documentation has information in it.
2:43 On 18 more installable panels that could help you squish your next bug.


Talk Python's Mastodon Michael Kennedy's Mastodon