【问题标题】:is there any way to run bottle application in daemon mode有什么方法可以在守护程序模式下运行瓶子应用程序
【发布时间】:2014-11-25 22:15:19
【问题描述】:

我有一个基于 Bottle(python) 框架构建的 Web 应用程序,我想在守护程序模式下运行它。有什么方法可以在守护程序模式下运行它

谢谢

【问题讨论】:

标签: python bottle


【解决方案1】:

当然可以。在您的操作系统上安装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()

【讨论】:

    猜你喜欢
    • 2015-06-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-10
    • 2016-12-06
    • 1970-01-01
    相关资源
    最近更新 更多