Skip to main content

Lightweight performance devbar for Django

Project description

django-devbar

[!WARNING] This package is experimental and may introduce breaking changes in minor versions.

Lightweight performance devbar for Django. Shows DB query count, query duration, application time, and detects similar and duplicate queries with visual severity indicators.

Showcase

Normal operation – showing query count, duration, and application time:

devbar example

Similar and duplicate queries detected – severity indicators and details shown:

devbar warning example

[optional] Chrome extension - showing detailed metrics in DevTools panel:

Chrome DevTools extension

Motivation

While Django Debug Toolbar is a proven tool trusted by countless projects, django-devbar explores a different approach to development debugging:

  • Minimal setup — just add middleware, nothing else required
  • Browser DevTools integration — Chrome extension panel works with any response type, including JSON
  • Zero extra dependencies — only requires Django
  • Lower overhead — no extra requests to debug endpoints
  • Non-intrusive — HTML bar is optional; works via headers and DevTools panel alone

Installation

# Using uv (recommended)
uv add --dev django-devbar

# Or using pip
pip install django-devbar

Add to your middleware early. For example:

MIDDLEWARE = [
    "django.middleware.security.SecurityMiddleware",
    # ...
]

if DEBUG:
    idx = MIDDLEWARE.index("django.middleware.security.SecurityMiddleware")
    MIDDLEWARE.insert(idx + 1, "django_devbar.DevBarMiddleware")

This keeps the middleware active only in development and avoids import errors if the package isn't installed in production.

Configuration

All settings are optional. Configure via a DEVBAR dict in your Django settings:

DEVBAR = {
    "POSITION": "bottom-right",  # bottom-right (default), bottom-left, top-right, top-left
    "SHOW_BAR": None,  # follows DEBUG; set True/False to override
    "ENABLE_DEVTOOLS_DATA": None,  # follows DEBUG; set True/False to override
}

Response Headers

Django DevBar adds HTTP response headers with performance metrics:

  • Server-Timing (always present) – Standard HTTP header with database, application, and total time metrics. Visible in Chrome DevTools Network tab under Timing.

An additional header is included by default in DEBUG mode:

  • DevBar-Data - JSON header with comprehensive metrics including similar and duplicate query details

This is useful for:

  • API endpoints where the HTML overlay can't be displayed
  • Automated testing to assert performance metrics (e.g., fail CI if query count exceeds a limit)
  • Browser extensions that need detailed duplicate query information

Server-Timing format

Server-Timing: db;dur=87.50, app;dur=41.30, total;dur=128.80

Chrome Extension

View Django DevBar metrics directly in Chrome DevTools with the official extension.

See chrome-extension/README.md for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_devbar-0.6.1.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_devbar-0.6.1-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file django_devbar-0.6.1.tar.gz.

File metadata

  • Download URL: django_devbar-0.6.1.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for django_devbar-0.6.1.tar.gz
Algorithm Hash digest
SHA256 c757a57031e2101653dd6d3069f5144d2145bc562d35fb9e9e45cf02f860bd1f
MD5 a7dee2b185411a0c5e7e455578e908d6
BLAKE2b-256 7bc7a2beb4e9f7624217a0193aa7a470891c30301f026aabe4fdeac9e0b61b2b

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_devbar-0.6.1.tar.gz:

Publisher: release.yml on amureki/django-devbar

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_devbar-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: django_devbar-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for django_devbar-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cdecb0aed367c3c41ba60551be0eeccd9de3cfd74d20bad6d366a470740f340d
MD5 f6cfde08c94e29916da8f46386d0e3f5
BLAKE2b-256 4f0476f0c1478c6c054b03efaa1141d82147a314fe4c3dcc4d12c34ba5c497c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_devbar-0.6.1-py3-none-any.whl:

Publisher: release.yml on amureki/django-devbar

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page