在Eclipse2.2中,使用以下代码创建TurboGears文件将允许在tg_launch.py中使用断点(安装了PyDev插件)对其进行调试:
if __name__ == '__main__':
from paste.script.serve import ServeCommand
ServeCommand("serve").run(["development.ini"])现在,在TG2.3中,粘贴已经被变速箱所取代,我似乎不知道新代码应该是什么。我试着在ServeCommand中使用gearbox.commands.serve,但是没有正确的参数.
有人能帮我吗?
发布于 2013-09-12 13:28:10
我想我找到了正确的方法。下面是要放在“tg_launch.py”中的代码:
if __name__ == '__main__':
from gearbox.main import GearBox
gearbox = GearBox()
gearbox.run(["serve", "--config=development.ini"])如果要调试安装程序(引导代码),请使用以下代码:
gearbox.run(["setup-app", "--config=development.ini"])有关所有可用命令和选项,请参阅http://turbogears.readthedocs.org/en/latest/turbogears/gearbox.html。
https://stackoverflow.com/questions/18748300
复制相似问题