Django Gunicorn Debug

后端 未结 5 468
陌清茗
陌清茗 2021-01-11 23:52

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

5条回答
  •  滥情空心
    2021-01-12 00:35

    What I finally ended up doing is run python manage.py runserver :8000 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 ;)

提交回复
热议问题