【发布时间】:2014-11-25 22:15:19
【问题描述】:
我有一个基于 Bottle(python) 框架构建的 Web 应用程序,我想在守护程序模式下运行它。有什么方法可以在守护程序模式下运行它
谢谢
【问题讨论】:
-
您可以使用
supervisord来守护和控制瓶子。例如,请参阅this article。
我有一个基于 Bottle(python) 框架构建的 Web 应用程序,我想在守护程序模式下运行它。有什么方法可以在守护程序模式下运行它
谢谢
【问题讨论】:
supervisord 来守护和控制瓶子。例如,请参阅this article。
当然可以。在您的操作系统上安装BottleDaemon 0.1.0,然后像这样更改您的路由器文件:
from bottledaemon import daemon_run
from bottle import route
@route("/hello")
def hello():
return "Hello World"
# The following lines will call the BottleDaemon script and launch a daemon in the background.
if __name__ == "__main__":
daemon_run()
【讨论】: