有什么办法可以在守护模式下运行瓶子的应用程序吗?[英] is there any way to run bottle application in daemon mode

本文是小编为大家收集整理的关于有什么办法可以在守护模式下运行瓶子的应用程序吗?的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

我有一个构建在瓶子(Python)框架工作的Web应用程序,我想以守护程序模式运行它.

谢谢

推荐答案

确保可以.安装 bettledaemon 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()

本文地址:https://www.itbaoku.cn/post/1975347.html

问题描述

I have a web application built on bottle(python) frame work and I want to run it in daemon mode.Is there any way to run it in daemon mode

Thanks

推荐答案

Sure you can. Install BottleDaemon 0.1.0 on your OS and than change your router file like so:

    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()