Since version 1.26, in web2py/ run
python2.5 shell.py [application]
If ipython is installed you will have an ipython shell in the web2py [application]. If [application] does not exist, it is created.
You may also want to read Michael's blog http://michaelangela.wordpress.com/2008/03/08/interactive-web2py-testing/