Skip to content

Debugging with iPython

Michal Fojtik edited this page Jun 25, 2013 · 2 revisions

Requirements

$ yum install python-ipython
$ cd tuskar
$ find . | grep no-global-site-packages.txt | xargs rm # This will allow to import 'global' packages in Tox

Debugging

Place these two lines in the place you want to debug/drop to shell:

import IPython
IPython.embed()

Then start tuskar as usual and do a GET/POST/etc. Once the code execution hit that two lines, you will be dropped into the iPython shell and you will have access to all local variables and env defined in the context of where you placed that two lines.

Tweaks

ipythonrc -> Colors on console, tab completetion for methods and more ;-)

Clone this wiki locally