Skip to main content

No project description provided

Project description

Django Debug Requests & Responses (DDRR)

Get more out of your runserver development output! Print request and response headers, body (with pretty-printing), etc. Highly customizable!

  • Log request headers
  • Log request body
  • Pretty-print JSON request and response bodies
  • ...and more!

DDRR can also be used for general logging with some configuration of your own.

Installation

$ pip install ddrr
  1. Add ddrr to your INSTALLED_APPS:

    # in settings.py
    INSTALLED_APPS = (
        # ...
        "ddrr",
    )
    
  2. Configure the logging of your Django app to use DDRR:

    # in settings.py
    import ddrr
    ddrr.quick_setup()
    
  3. Done!

Customization

Change output formats

TODO

How it works

The middleware ddrr.middleware.DebugRequestsResponses sends the entire request object as the message to ddrr-request-logger. This logger has been configured to use ddrr.formatters.DefaultRequestFormatter which internally uses Django's built-in template engine to format the request into human-readable form. By default, this is shown in your console output, but you can easily configure it to log it to a file, ElasticSearch, or anything else.

Similar projects

Development and contributions

PR's are always welcome!

For hacking on DDRR, make sure you are familiar with:

Install dependencies and set up the pre-commit hooks.

$ poetry install
$ pre-commit install

The pre-commit hooks will, among other things, run Flake8 on the code base and Black to make sure the code style is consistent across all files. Check out .pre-commit-config.yaml for details.

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

ddrr-0.1.1.tar.gz (8.1 kB view hashes)

Uploaded Source

Built Distribution

ddrr-0.1.1-py2.py3-none-any.whl (8.4 kB view hashes)

Uploaded Python 2 Python 3

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