Install and setup ipython for zope
I was demonstrated by Stefan (seletz) Eletzhofer how to run ipython as an interactive shell for Zope.
I was impressed enough by what he showed me to want to write some how-to about it and spread the info.
ipython can be used as a replacement to the
zopectl debug command.
InstallFirst of all, we need to install ipython, you can use setup tools to install it from source, or install it from an egg.
If you install it from an egg (assuming you have easy_install installed), you would simply key:
$ easy_install ipython
Which is easy enough, right?
Now we want to set it up for Zope.
Stefan wrote a custom setup profile for ipython.
it is hosted in the collective, under the dotipython project.
first go to the .ipython folder in your home directory:
$ cd ~/.ipython
If there is no .ipython in your home dir, launch ipython once and quit to have it created.
Then grab the file (here I use svn but you can use wget or download it with any web browser as it is a single file):
$ svn co http://svn.plone.org/svn/collective/dotipython/trunk/ipy_profile_zope.py .
It's all it needs really, now we can start our ipython session.
Zope needs some system environment to be set (
We can do that by using the
zopectl shell command:
$ cd ~/my/zope/instance $ ./bin/zopectl shell
make sure the setup is right:
$ echo $INSTANCE_HOME
Now all you need is to run the ipython shell with the profile we installed previously:
$ ipython -p zope
And you can start playing with it.
Don't forget to have a look at iPython excellent documentation:
There are alternate ways to use iPython and the zope debugger. See those very good related links:
And in french: