Skip to main content

django-http-debug

PyPI Tests Changelog License

Django app for creating database-backed HTTP debug endpoints

Installation

Install this library using pip:

pip install django-http-debug

Configuration

Once installed in the same environment as your Django application, add the following to INSTALLED_APPS in your Django settings:

INSTALLED_APPS = [
    # ...
    'django_http_debug',
    # ...
]

And add this to MIDDLEWARE:

MIDDLEWARE = [
    # ...
    "django_http_debug.middleware.DebugMiddleware",
    # ...
]

Then run ./manage.py migrate to create the necessary database tables.

Usage

You can configure new endpoints in the Django admin. These will only work if they are for URLs that are not yet being served by the rest of your application.

Give an endpoint a path (starting without a /) such as:

webhooks/debug/

You can optionally configure the returned body or HTTP headers here too.

If you want to return a binary body - a GIF for example - you can set that endpoint to use Base64 encoding and then paste a base64-encoded string into the body field.

On macOS you can create base64 strings like this:

base64 -i pixel.gif -o -

Any HTTP requests made to /webhooks/debug/ will be logged in the database. You can view these requests in the Django admin.

You can turn off the "Logging enabled" option on an endpoint to stop logging requests to it to the database.

Development

To contribute to this library, first checkout the code. Then create a new virtual environment:

cd django-http-debug
python -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest

Release files for django-http-debug 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-http-debug 0.2
File Size Uploaded
django_http_debug-0.2.tar.gz 10.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-http-debug 0.2
File Interpreter ABI Platform
django_http_debug-0.2-py3-none-any.whl Python 3 none any Details

Total release size: 22.8 kB

Release files / django_http_debug-0.2.tar.gz

Download URL django_http_debug-0.2.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8e52ed563f8df9875435536c06ccaf216d1a429ed95dbb975c8082ca657f8f65
BLAKE2b-256 checksum
How to use checksums
0c0bfe3efe8b814de265b771a7183dac9dd553e95a98e088ffa87bc80da956fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / django_http_debug-0.2-py3-none-any.whl

Download URL django_http_debug-0.2-py3-none-any.whl
Size 12.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8bc622eaf2d84067586fb391108dcc159a4ca0afac3b23aeddb90c709f0bf968
BLAKE2b-256 checksum
How to use checksums
a7974e3ab10decaa76a7a2d905dc18597efd3299f625fca590ebe7c3431d9b3e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release history Release notifications | RSS feed

This release

0.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page