-
Notifications
You must be signed in to change notification settings - Fork 0
PDB Debugger
Kevin Postal edited this page Apr 6, 2014
·
2 revisions
Tricks and tips for Python and Django development
## 1. Python Debugger pdb implements an interactive debugging environment for Python programs. It includes features to let you pause your program, look at the values of variables, and watch program execution step-by-step, so you can understand what your program actually does and find bugs in the logic. ([https://bitbucket.org/dugan/epdb](https://bitbucket.org/dugan/epdb))-
Add the import line to set breakpoint in your code.
import epdb; epdb.serve(4242)
-
Trigger the code block and launch the Django Shell with manage.py.
python manage.py shell
-
Enter the following:
import epdb; epdb.connect(host='127.0.0.1', port=4242)
-
Debug!