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
What I finally ended up doing is run python manage.py runserver when I want to use pdb.
So you need to have 2 different repositories in the same machine, one being LIVE production build (the one running gunicorn) and the other being the TEST build, the one I need to debug on where I use pdb. When things seem stable on TEST build I merge the TEST branch with LIVE branch. No development or changes happen on LIVE branch that way I avoid merge conflicts.
Hopefully this helps others who are addicted to pdb ;)