Debug toolbar

Instalación

pip install django-debug-toolbar

Prerrequisitos

# settings.py
INSTALLED_APPS = [
    "django.contrib.staticfiles",

]

STATIC_URL = "static/"

TEMPLATES = [
    {
        "BACKEND": "django.template.backends.django.DjangoTemplates",
        "APP_DIRS": True,
        # ...
    }
]

Instalar la app

INSTALLED_APPS = [
    # ...
    "debug_toolbar",
    # ...
]

Añadir las urls

from django.urls import include, path

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

Añadir el Middleware

MIDDLEWARE = [
    # ...
    "debug_toolbar.middleware.DebugToolbarMiddleware",
    # ...
]

Configurar internal ips

INTERNAL_IPS = [
    # ...
    "127.0.0.1",
    # ...
]
Última modificación November 6, 2022: update (704d0e4)