0

如何正确启动cherrypy?它在 3.0 中对我有用,但现在我可以提供内容,但每次触摸源时都必须启动我的服务,即使自动重新加载器正在运行。

我已经添加了该cherrypy.engine.block()语句,该语句有效,但cherrypy随后停止为我的应用程序提供服务(浏览器中没有答案,即使它正确打开了TCP端口)。

那么关于在哪里或寻找什么的任何线索或见解?

这是在标准输出上:

[30/Dec/2012:17:05:28] ENGINE Bus STARTING<br>
[30/Dec/2012:17:05:28] ENGINE Started monitor thread 'Autoreloader'.<br>
[30/Dec/2012:17:05:28] ENGINE Started monitor thread '_TimeoutMonitor'.<br>
[30/Dec/2012:17:05:28] ENGINE Serving on 0.0.0.0:8080<br>
[30/Dec/2012:17:05:28] ENGINE Bus STARTED<br>
[30/Dec/2012:17:05:28] ENGINE Bus STARTING<br>
[30/Dec/2012:17:05:28] ENGINE Monitor thread 'Autoreloader' already started.<br>
[30/Dec/2012:17:05:28] ENGINE Monitor thread '_TimeoutMonitor' already started.<br>
[30/Dec/2012:17:05:28] ENGINE Already serving on 0.0.0.0:8080<br>
[30/Dec/2012:17:05:28] ENGINE Bus STARTED<br>

我如何开始它:

cherrypy.tree.mount(login(), '/', configPath)<br>
cherrypy.tree.mount(reservation(), '/reservation', configPath)<br>
cherrypy.tree.mount(administration(), '/reservation/administration', configPath)<br>
cherrypy.server.socket_host= "0.0.0.0"<br>
cherrypy.engine.start()
4

2 回答 2

1

正如 Makoto 所说,看起来您已经启动了两次 CherryPy。您是否同时调用了 engine.start/engine.block 和cherrypy.quickstart?如果是这样,请删除其中一个。

于 2012-12-30T18:29:40.973 回答
0

我的问题是cherrypy的旧版本(实际上是他们网站上链接的最新版本!)与python 3.3结合使用。从 bitbucket 获取最新的软件包为我解决了这个问题!

于 2013-04-30T17:12:53.907 回答