Mar 06, 2017

How To Install Django Debug Toolbar

Alejandro León González


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.

For the installation of the Django Debug Toolbar you need to have a django project where you can use pip in a Virtual Environment or without them. If you wan’t use pip, you can get the code of this component from here ( and put it in your django project path. But is more easy the pip installation and we will focus on this.

For installation we recommend use the virtual env and execute this command:

pip install django-debug-toolbar

The configuration of this component is simple, but because most of the configuration must be done in the core of the settings of the project, we recommend to do it independently.

First, in your general project, enter this code:

from django.conf import settings
from django.conf.urls import include, url

if settings.DEBUG:
   import debug_toolbar
   urlpatterns += [
       url(r'^__debug__/', include(debug_toolbar.urls)),

Take care with the “imports” because it’s possible that you duplicate some of this.

In the we enter our independent conf for this component, like this:

DEBUG = True

   INTERNAL_IPS = ('', 'localhost',)




The INTERNAL_IPS conf is valid for a local development environment, if your dev env is different, you just change this field with your valid conf.

This is the default conf and if you want see more options you can see this page:

Note: Is very important that you have the close body tag ( </body> ) in your base template for the Django Debug Toolbar is showing.

This component has a variety of panels that can be added through the configuration, these panels show different information related to http requests / responses and other relevant debug data, in this url you can see all differents default panels and you can learn how to use and configure it.

The result will be a toolbar in your screen right place with debug information like this:


And here's a screenshot of the toolbar in action:

Leave a comment