Quickstart
Install the Django App via Pypi.
python -m pip install django-dump-die
Add the corresponding app to your Django
settings.pyfile:INSTALLED_APPS = [ 'django_dump_die', ... ]
Add the corresponding middleware to your Django
settings.pyfile:MIDDLEWARE = [ 'django_dump_die.middleware.DumpAndDieMiddleware', ... ]
Ensure that you have DEBUG set to
Truein your Djangosettings.pyfile:DEBUG = True
Note
Neither the
dumpcommand nor theddcommand will do anything ifDEBUGis not set toTrue. With that said, this is a tool for debugging. You should not include this package in production nor should you ever haveDEBUGset toTruein production.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)