is there any way to run bottle application in daemon mode

余生长醉 提交于 2019-12-03 15:14:13

问题


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


回答1:


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


来源:https://stackoverflow.com/questions/26135159/is-there-any-way-to-run-bottle-application-in-daemon-mode

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!