Django Gunicorn Debug

后端 未结 5 434
陌清茗
陌清茗 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:24

    I managed now to use gunicron with djnago and ipdb.

    run python -m ipdb manage.py run_gunicorn --debug -t 3600

    I'm using Django 1.4 and gunicorn 0.16.1. then you can normally use the import ipdb; ipdb.set_trace() in the code. There is no need for the werkzeug library.

    I'm trying to debug a facebook app, so I can't use the build in development server, because facebook tries to use SSL and the dev server just can't respond properly

    While I was looking for a solution, I found a post pdb: Using the Python debugger in Django that suggests to run python -m pdb manage.py runserver all the time. Although this is not necessary with django's dev server, I decided to give it a try with gunicordn and ipdb and it worked.

提交回复
热议问题