Initially I had a Django app with the included testing server. To debug this setup, I can just add a import pdb; pdb.set_trace() anywhere in the code and have a
If you are able to launch gunicorn pointing at an application instance that is an instance of the DebuggedApplication class from the werkzeug library, you will be able to set break points using the werkzeug debugger with import ipdb; ipdb.set_trace() right in your browser.
import django.core.handlers.wsgi
from werkzeug.debug import DebuggedApplication
application = django.core.handlers.wsgi.WSGIHandler()
application = DebuggedApplication(application, evalex=True)
Make sure you install werkzeug library and ipdb of course. (pip install werkzeug and pip install ipdb)