A number of people saw the debugging Django post and suggested I'd write one covering TurboGears as well. Great idea, so here goes...
I found the best approach for this was to use the remote debugging method:
import dbgp.client dbgp.client.brk(host="localhost", port=9000)
Note: Change "localhost" to be the machine Komodo is running on (it can be on a different machine) and change 9000 to be the debug port Komodo is set to listen to, you can find this debugger port by looking at Komodo's menu "Debug->Listener Status".
This ensures that Komodo's dbgp debugging client gets properly initialized and any subsequent threads will get properly debugged by Komodo.
class Root(controllers.RootController):
@expose(template="todd1.templates.welcome")
def index(self):
brk() # Make Komodo debugging break here
return dict(now=time.ctime())
from dbgp.client import brk # Import Komodo debugger brk function
import time
from turbogears import controllers, expose, flash
class Root(controllers.RootController):
@expose(template="todd1.templates.welcome")
def index(self):
brk() # Make Komodo debugging break here
return dict(now=time.ctime())export PYTHONPATH=/path-to-komodo-install/lib/support/dbgp/pythonlibpython start-projname.py
Some notes on TurboGears and autoreload:
autoreload.on=False