Django Debug Toolbar: Helper for django developers

Adi Ramadhan
2 min readMay 22, 2023


Showing History, versions, time, settings, and other helpful information for django developer.
Official docs django-debug-toolbar

django with django-debug-toolbar

Project Structure:

Step 1: Preparation, Create Django Project, Inital Migration
create virtualenv: virtualenv venv
start virtualenv: venv/Scripts/activate
install Django and django-debug-toolbar in virtualenv: pip install django==4.2 django-debug-toolbar
Create Django: django-admin startproject myproject
Go to myproject folder: cd myproject
Initial Migration: python migrate

Step 2: Create Django Apps
Create apps: python startapp myapp

Step 3: Project Setting: Register Apps and Django Debug Toolbar, Set Templates Folder (myproject/
Make sure static is configured, add myapp and debug_toolbar in INSTALLED_APPS, setup TEMPLATES folder, add INTERNAL_IPS


'django.contrib.staticfiles', #make sure this is configured in settings

'myapp', #updated
'debug_toolbar', #updated



'DIRS': [Path(BASE_DIR, 'templates')], #updated


STATIC_URL = 'static/' #make sure this is configured in settings


# ...
"", #updated
# ...

Step 4: Add Templates Folder and Files
Create templates folder in root
Create index.html

<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hello World</title>
<h1>Hello World.</h1>
<p>This is html page!</p>

Step 5: Create View in myapp/

from django.shortcuts import render

# Create your views here.
def index(request):
return render(request, 'index.html', {})

Step 6: Setup URLs in myapp and myproject Folder

Create myapp/

from django.urls import path
from . import views

urlpatterns = [
path('', views.index, name = "index"), #updated


Update myproject/

from django.urls import path, include #updated

urlpatterns = [
path('', include('myapp.urls')), #updated
path('__debug__/', include('debug_toolbar.urls')), #updated

Step 7: Run Server and Test
Run Server: python runserver

django debug toolbar shown in django apps