In TurboGears 2.2, creating a tg_launch.py file with the following code would allow to debug it using breakpoint in Eclipse (PyDev plugin is installed):
if __name__ == '__main__':
from paste.script.serve import ServeCommand
ServeCommand("serve").run(["development.ini"])
Now, with TG 2.3, paste has been replaced with gearbox and I can't seem to figure out what the new code should be. I tried using the ServeCommand in gearbox.commands.serve but could not get the arguments right...
Can anyone help me out?
I believe I found the proper way to do it. Here is the code to to put in the "tg_launch.py":
if __name__ == '__main__':
from gearbox.main import GearBox
gearbox = GearBox()
gearbox.run(["serve", "--config=development.ini"])
If you want to debug your setup (bootstrap code) use the following:
gearbox.run(["setup-app", "--config=development.ini"])
Refer to http://turbogears.readthedocs.org/en/latest/turbogears/gearbox.html for all available commands and options.