Skip to main content

Django app for creating database-backed HTTP debug endpoints

Project description

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.

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

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

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_http_debug-0.1a0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

django_http_debug-0.1a0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file django_http_debug-0.1a0.tar.gz.

File metadata

  • Download URL: django_http_debug-0.1a0.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for django_http_debug-0.1a0.tar.gz
Algorithm Hash digest
SHA256 be1f31cbc1188471b3c66c047b4b3e910468ae1d135f1ce153bfa1c91395610e
MD5 e51c4233f2634eb3c7f12e25c210335a
BLAKE2b-256 3f3ee195ea5c2488570876d46b99cabfa1cf1255b057a9efc69f2ab56d40230a

See more details on using hashes here.

File details

Details for the file django_http_debug-0.1a0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_http_debug-0.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 5564dfc817b89e006ff87cf789bf839f376b0175533c0258c6986f7d3125481b
MD5 cd05980a31e8170b77d9c2b05ad22097
BLAKE2b-256 7c32665a27db03b2380a5f076cefc389d9d84d1416d2677bd2f1327a462426f8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page