Skip to main content

Lightweight performance devbar for Django

Project description

django-devbar

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

devbar example

devbar warning example

Note: This package is experimental and may introduce breaking changes in minor versions.

Installation

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

# Or using pip
pip install django-devbar

Add to your middleware as early as possible, but after any middleware that encodes the response (e.g., GZipMiddleware):

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

Configuration

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

DEVBAR = {
    'POSITION': 'bottom-right',  # bottom-right, bottom-left, top-right, top-left
    'SHOW_BAR': None,            # None (default) = follows DEBUG, or True/False to override
    'SHOW_HEADERS': False,       # Add DevBar-* headers to responses
}

Response Headers

When DEVBAR = {'SHOW_HEADERS': True}, performance metrics are added as HTTP response headers. 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)
  • Monitoring tools that can capture and aggregate header values

Headers included:

Header Example Description
DevBar-Query-Count 12 Number of database queries executed
DevBar-DB-Time 87ms Total time spent in database queries
DevBar-App-Time 41ms Application time (total time minus DB time)
DevBar-Duplicates 3 Number of duplicate queries detected (only present if duplicates found)

Chrome Extension

Chrome DevTools extension

View Django DevBar metrics directly in Chrome DevTools with the official extension. Requires DEVBAR = {'SHOW_HEADERS': True}.

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.3.0.tar.gz (5.5 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.3.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_devbar-0.3.0.tar.gz
  • Upload date:
  • Size: 5.5 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.3.0.tar.gz
Algorithm Hash digest
SHA256 5c45896461cee0138715f9731b0cff6477b92fdb21e8d41ef158c40837ecc001
MD5 44d73303f74621ef8a2ae8b37cc45484
BLAKE2b-256 2530756de0946974a5040b265a3072206d6c0474862a4b9b218de2123330896b

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_devbar-0.3.0.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.3.0-py3-none-any.whl.

File metadata

  • Download URL: django_devbar-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bbdc6860c7cec4b595a80ab4f089052f4e99473056b498d0ad952f097f3573e0
MD5 b8986b7b16a79fafdce3224314dd27dd
BLAKE2b-256 ecfa02f277418e4125041d4a8c2ef5443666a09e450a813ed6810e28d97ccf48

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_devbar-0.3.0-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