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.
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 DevBar-* response headers (default: False)
DEVBAR_SHOW_HEADERS = True
# Enable console logging for duplicate queries (default: True)
DEVBAR_ENABLE_CONSOLE = True
# Performance thresholds for warning/critical levels (defaults shown)
DEVBAR_THRESHOLDS = {
"time_warning": 500, # ms
"time_critical": 1500, # ms
"count_warning": 20, # queries
"count_critical": 50, # queries
}
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 | 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_devbar-0.1.2.tar.gz.
File metadata
- Download URL: django_devbar-0.1.2.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c8ce24ade421977f2145b74897d45f0796278efb76dd81437ec75c3ab63781d
|
|
| MD5 |
a807fbfbe0b7bdb145738249504bf981
|
|
| BLAKE2b-256 |
522b9d09ce2e6355e20bc2d6815c7ecca327c2b173c7d96cf414aad92ba41001
|
Provenance
The following attestation bundles were made for django_devbar-0.1.2.tar.gz:
Publisher:
release.yml on amureki/django-devbar
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_devbar-0.1.2.tar.gz -
Subject digest:
1c8ce24ade421977f2145b74897d45f0796278efb76dd81437ec75c3ab63781d - Sigstore transparency entry: 760300876
- Sigstore integration time:
-
Permalink:
amureki/django-devbar@047c9c7c75218c8564889013fd9e18bad93fdfa2 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/amureki
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@047c9c7c75218c8564889013fd9e18bad93fdfa2 -
Trigger Event:
release
-
Statement type:
File details
Details for the file django_devbar-0.1.2-py3-none-any.whl.
File metadata
- Download URL: django_devbar-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31a7233024e041bf6b7c223b86e0882b24b55fae38998aa5de6552b37d752840
|
|
| MD5 |
46b37946a561979fbca822216a0f71e3
|
|
| BLAKE2b-256 |
d91461f4330789ee77c64557e0627d3239d1cf2c091f95a8f3dc03b00a56b7e6
|
Provenance
The following attestation bundles were made for django_devbar-0.1.2-py3-none-any.whl:
Publisher:
release.yml on amureki/django-devbar
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_devbar-0.1.2-py3-none-any.whl -
Subject digest:
31a7233024e041bf6b7c223b86e0882b24b55fae38998aa5de6552b37d752840 - Sigstore transparency entry: 760300885
- Sigstore integration time:
-
Permalink:
amureki/django-devbar@047c9c7c75218c8564889013fd9e18bad93fdfa2 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/amureki
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@047c9c7c75218c8564889013fd9e18bad93fdfa2 -
Trigger Event:
release
-
Statement type: