If you put
import pdb
pdb.set_trace()
in your code, the web application will crash into the pdb debugger session after execution set_trace.
Also useful
import code
code.interact(local=locals())
which brings you to the python interpreter. Pressing Ctrl-d resumes execution.
Even more useful
import IPython.Shell
ipshell = IPython.Shell.IPShellEmbed()
ipshell(local_ns=locals())
which takes you to an IPython session (assuming you installed IPython). Here, also pressing Ctrl-d resumes execution.
source
share