Quickstart

  1. Install the Django App via Pypi.

    python -m pip install django-dump-die
    
  2. Add the corresponding app to your Django settings.py file:

    INSTALLED_APPS = [
    
        'django_dump_die',
        ...
    ]
    
  3. Add the corresponding middleware to your Django settings.py file:

    MIDDLEWARE = [
    
    
        'django_dump_die.middleware.DumpAndDieMiddleware',
        ...
    ]
    
  4. Ensure that you have DEBUG set to True in your Django settings.py file:

    DEBUG = True
    

    Note

    Neither the dump command nor the dd command will do anything if DEBUG is not set to True. With that said, this is a tool for debugging. You should not include this package in production nor should you ever have DEBUG set to True in production.

  5. From a file that is part of the request / response cycle such as a Django View in views.py, make a call to dd sending it the contents of a variable to inspect.

    views.py

    def my_awesome_view(request):
        dd(request)