【发布时间】:2019-04-25 08:41:58
【问题描述】:
我的 CherryPy 服务器中嵌入(移植)了一个 WSGI 应用程序。
from my_app import application
import cherrypy
if __name__ == '__main__':
cherrypy.config.update("server.conf")
cherrypy.tree.graft(application, "/good_stuff/")
cherrypy.engine.start()
cherrypy.engine.block()
其中server.conf 是定义服务器属性等的静态配置文件。
[global]
server.socket_host = "0.0.0.0"
server.socket_port = 8087
server.thread_pool = 30
现在我想使用 cherryd 实用程序将 CherryPy 作为守护程序服务运行,因此我应该将代码中的嫁接部分转换为静态配置。
[global]
...
tree.graft = {my_app.application:"/good_stuff/"}
我找不到这方面的工作示例,但显然不行:
AttributeError: 'ReloaderApp' object has no attribute 'rstrip'
当我尝试启动它时:
$ cherryd -c server.conf -i my_app
想法?
【问题讨论】: