Skip to main content

Lightweight performance devbar for Django

Project description

django-devbar

Lightweight performance devbar for Django. Shows DB query count, query duration, and response time.

devbar example

Installation

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

# Position: bottom-right, bottom-left, top-right, top-left (default: bottom-right)
DEVBAR_POSITION = "top-left"

# Show HTML overlay (default: DEBUG)
DEVBAR_SHOW_BAR = True

# Add X-DevBar-* response headers (default: False)
DEVBAR_SHOW_HEADERS = True

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 thresholds (e.g., fail CI if query count exceeds a limit)
  • Monitoring tools that can capture and aggregate header values

Headers included:

Header Description
X-DevBar-Query-Count Number of database queries executed
X-DevBar-Query-Duration Total time spent in database queries (ms)
X-DevBar-Response-Time Total request-response cycle time (ms)
X-DevBar-Has-Duplicates Present (value 1) if duplicate queries detected

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.1.1.tar.gz (3.6 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.1.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_devbar-0.1.1.tar.gz
  • Upload date:
  • Size: 3.6 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.1.1.tar.gz
Algorithm Hash digest
SHA256 7e0d8290fa8b73946665086dbf8ad1ebdbcfb8bec0d5b9991425b664c72215e2
MD5 816d728fe0ea5c6f0560bd74033fceee
BLAKE2b-256 8333917df672a0e4039debfe0f39d7285a028aa997879a01c7c2c37de6634218

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: django_devbar-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.8 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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 acd39fb075968a00bce7391e8a5a566d4e1aefe5b7ffc15969e9ff0e97227e39
MD5 c1c0e82c49cb2ff74f61ea548fe2565a
BLAKE2b-256 0b3587ec392a3157c5bc5179b503032da78b16ed538d91f77f5e6e336b7cef3b

See more details on using hashes here.

Provenance

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