Toggling the Debug Toolbar

While developing with Django, you will want to inspect request headers and parameters, check the current template context, or measure the performance of SQL queries. All this and more is possible with the Django Debug Toolbar. It is a configurable set of panels that displays various debug information about the current request and response. In this recipe, I will guide you on how to toggle the visibility of the Debug Toolbar, depending on a cookie, set by bookmarklet. A bookmarklet is a bookmark of a small piece of JavaScript code that you can run on any page in a browser.

Getting ready

To get started with toggling the visibility of the Debug Toolbar, take a look at the following steps:

  1. Install the Django Debug Toolbar to ...

Get Web Development with Django Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.