As a Django newbie, I am always a bit at loss when I need to find out what is going on with my app. Sure the error page is quite informative (other frameworks could learn a thing or two about newbie friendly error pages from Django), but if you need a more powerful solution IPython Shell is the perfect answer.
Thanks to my mentor, Dusty, for sharing the secret with me. ;)
Using the IPython Shell is not difficult, and in fact, you will do that a lot while developing a Django app. You know, the ./manage.py shell routine...
Well, you can call the very same shell from your code wherever and whenever you need it.
You only need two things:
# Import the Shell from IPython library
from IPython import Shell
And then call the shell in your code
# Some code above...
Shell.IPShellEmbed()()
# Some more code below...
And that's it. Now when you start the server from console, the same console will display the shell when you hit the Shell.IPShellEmbed()() line.
A word of warning to wrap this up. Don't exit the shell with Ctrl+C. If you do that, you will have to reset your console (and the server will be stopped as well). Also, the things you type will not be echoed to the screen. Well, if you don't get this part, just remember to exit the shell with Ctrl+D so that your Django site can continue functioning.
As an aside, I like the IPython shell very much. It's beautifully colored and much more pleasant to work with from an aesthetical point of view. (Green on black! Who wouldn't fall for that?!) Otherwise, it's much like Ruby on Rails' shell, does the same things.