Django plugin that configures the Django Debug Toolbar
Project description
django-plugin-django-debug-toolbar
Django plugin that installs and configures the Django Debug Toolbar
Goal
The Django Debug Toolbar is amazingly useful for development. It's so powerful that it's very dangerous to activate it in production.
The goal of this plugin is to enable a developer to activate the Django Debug Toolbar with the minimum number of steps, while keeping debug related code out of the codebase.
Installation
First configure your Django project to use DJP.
Then install this plugin in the same environment as your Django application.
pip install django-plugin-django-debug-toolbar
Usage
Looking at Django Debug Toolbar's installation instructions, this plugin takes care of the following steps (using their numbering):
- #1. Install the Package
- #3. Install the App
- #4. Add the URLs
- #5. Add the Middleware
- #6. Configure Internal IPs
- to include
127.0.0.1
- to include
But you still need to:
- #2. Check for Prerequisites
- like settings for static files and templates
- #6. Configure Internal IPs
- if you require IPs other than
127.0.0.1
, set them inINTERNAL_IPS
in your settings
- if you require IPs other than
- #7. Disable the toolbar when running tests (optional)
- perhaps do this by disabling DJP when testing
Middleware ordering
This plugin injects the Debug Toolbar Middleware early, but not too early, in the middleware list.
It needs to run after any midddleware that decodes requests (GZipMiddleware
), or sets request.META['REMOTE_ADDR']
(like django-xforwardedfor-middleware
or django-xff
).
If you have any other middleware that needs to run before the Debug Toolbar Middleware, please open a ticket and we'll add it to the TOOLBAR_MUST_GO_AFTER
list.
Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd django-plugin-django-debug-toolbar
python -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
python -m pytest
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
Built Distribution
File details
Details for the file django_plugin_django_debug_toolbar-0.4.1.tar.gz
.
File metadata
- Download URL: django_plugin_django_debug_toolbar-0.4.1.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1de3b81ca4369c6d6c58ff9dd92259b0ec276987a0e8f7348eb086162c37f7bb |
|
MD5 | a0b7f4740e19abdca7cbe915278daf7e |
|
BLAKE2b-256 | c39cf1224bbf7fddb6c78afca7ddc15a06c871db00ea46b44aa160caefb333c1 |
Provenance
The following attestation bundles were made for django_plugin_django_debug_toolbar-0.4.1.tar.gz
:
Publisher:
publish.yml
on tomviner/django-plugin-django-debug-toolbar
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
django_plugin_django_debug_toolbar-0.4.1.tar.gz
- Subject digest:
1de3b81ca4369c6d6c58ff9dd92259b0ec276987a0e8f7348eb086162c37f7bb
- Sigstore transparency entry: 149604032
- Sigstore integration time:
- Predicate type:
File details
Details for the file django_plugin_django_debug_toolbar-0.4.1-py3-none-any.whl
.
File metadata
- Download URL: django_plugin_django_debug_toolbar-0.4.1-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91b54a1926d8ef6ca85e51009875910cfd2c1511b4125e49e2af395d31832ced |
|
MD5 | 0034fad8a2e356d6e62e73d2d1a09cb0 |
|
BLAKE2b-256 | 5a54cecd13ffd65ead29e417aaf5f218036afdcced086f2a29005d8aac73e578 |
Provenance
The following attestation bundles were made for django_plugin_django_debug_toolbar-0.4.1-py3-none-any.whl
:
Publisher:
publish.yml
on tomviner/django-plugin-django-debug-toolbar
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
django_plugin_django_debug_toolbar-0.4.1-py3-none-any.whl
- Subject digest:
91b54a1926d8ef6ca85e51009875910cfd2c1511b4125e49e2af395d31832ced
- Sigstore transparency entry: 149604033
- Sigstore integration time:
- Predicate type: