Using py DBGP to debug cherrypy – Work in progress

I will freely admit I am heavily addicted to the DBG protocol these days. For the uninformed, DBGp when combined with a proper client, allows for symbolic debugging of live and or remote applications in PHP and Python. I’ve used xdebug, the PHP implementation of DBGp for several years now and it has been a tremendous time saver debugging weird issues in staging and testing environments.

I’ve also used DBGp for simple Python applications, but have never been able to get the same functionality with more advanced products like cherrypy…. until now. I’ts kind of hokey, but all I needed to do was insert a python dbgp call liked

    from dbgp.client import brk
    def someCode(*args)
          brk(host="", port = "9000" )

And voila I got a session started inside one of my controller methods while it was walking through handling an OpenId response.

Very happy about this I must say as it will make it ever so much easier to figure out where the hell I’ve gone wrong.