Skip to main content

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
    "DEVTOOLS_HEADER_MAX_BYTES": 6144,  # max bytes for DevBar-Data header payload
    "DEVTOOLS_MAX_QUERIES": None,  # optional hard cap for q/dup entries sent to DevTools
}

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
    • Query-level flags are embedded in q entries (dup and sim)
    • Payload is automatically truncated to fit DEVTOOLS_HEADER_MAX_BYTES
    • When truncated, response includes metadata keys: tr, q_total, q_sent

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.

Release files for django-devbar 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-devbar 0.7.0
File Size Uploaded
django_devbar-0.7.0.tar.gz 9.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-devbar 0.7.0
File Interpreter ABI Platform
django_devbar-0.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.0 kB

Release files / django_devbar-0.7.0.tar.gz

Download URL django_devbar-0.7.0.tar.gz
Size 9.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6abd24023bd145f5abf97339913399b8c1dbef2fced0be06916c35286659f68d
BLAKE2b-256 checksum
How to use checksums
0cec63ecc60a34f30381f9ce0e2fa7745250c8ea5118ea1568f498d8d6da69dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 16, 2026.

Transparency log

Release files / django_devbar-0.7.0-py3-none-any.whl

Download URL django_devbar-0.7.0-py3-none-any.whl
Size 11.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c9f43a03aab79af747c37f2b34c16cd2d0306c97dd7277bf2839833240eadd4
BLAKE2b-256 checksum
How to use checksums
a571a41c3e41a04ea3d49fa7f3d81a00dfb9878fc3a17a6d7e9212abdb5f82be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 16, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page