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

查看:52
本文介绍了有什么办法可以在守护程序模式下运行Bottle应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

谢谢

推荐答案

可以.在您的操作系统上安装 BottleDaemon 0.1.0 ,然后像这样更改路由器文件:

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

这篇关于有什么办法可以在守护程序模式下运行Bottle应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆