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 X-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)

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.2.0.tar.gz (5.2 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.2.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_devbar-0.2.0.tar.gz
  • Upload date:
  • Size: 5.2 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.2.0.tar.gz
Algorithm Hash digest
SHA256 3425b2b44f1c1cd7869d9bb764afaf822e07c6aa80c3b66519a1267160c83ba8
MD5 38839c88a9cb207fd82af60caa555509
BLAKE2b-256 bcca618fe514e3cc69c98c46ed77485136d28a912af677d7cbd297af8dd5dbdd

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: django_devbar-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.1 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9fa413f84bd7b57eae2c032c5ddb7528d1f88d867a0f20142083545c351abee0
MD5 a8eb6ffc6f3e547458594d1907bbb668
BLAKE2b-256 dc1675e8cbb84bf76de776ad6ab3c83bb15f0c4e8dcfc22814837be6a5c72c10

See more details on using hashes here.

Provenance

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