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.
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
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
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.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c45896461cee0138715f9731b0cff6477b92fdb21e8d41ef158c40837ecc001
|
|
| MD5 |
44d73303f74621ef8a2ae8b37cc45484
|
|
| BLAKE2b-256 |
2530756de0946974a5040b265a3072206d6c0474862a4b9b218de2123330896b
|
Provenance
The following attestation bundles were made for django_devbar-0.3.0.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.3.0.tar.gz -
Subject digest:
5c45896461cee0138715f9731b0cff6477b92fdb21e8d41ef158c40837ecc001 - Sigstore transparency entry: 789566883
- Sigstore integration time:
-
Permalink:
amureki/django-devbar@1ecfd1e91f9801b6dec0065904bd5f43ac8403b0 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/amureki
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1ecfd1e91f9801b6dec0065904bd5f43ac8403b0 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bbdc6860c7cec4b595a80ab4f089052f4e99473056b498d0ad952f097f3573e0
|
|
| MD5 |
b8986b7b16a79fafdce3224314dd27dd
|
|
| BLAKE2b-256 |
ecfa02f277418e4125041d4a8c2ef5443666a09e450a813ed6810e28d97ccf48
|
Provenance
The following attestation bundles were made for django_devbar-0.3.0-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.3.0-py3-none-any.whl -
Subject digest:
bbdc6860c7cec4b595a80ab4f089052f4e99473056b498d0ad952f097f3573e0 - Sigstore transparency entry: 789566884
- Sigstore integration time:
-
Permalink:
amureki/django-devbar@1ecfd1e91f9801b6dec0065904bd5f43ac8403b0 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/amureki
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1ecfd1e91f9801b6dec0065904bd5f43ac8403b0 -
Trigger Event:
release
-
Statement type: