2014-10-01 50 views
3

我必须建立在瓶(Python)的工作框架的Web应用程序,我想在后台mode.Is有什么办法可以在守护模式下运行它运行有没有办法运行在后台模式瓶应用

谢谢

+4

您可以使用['supervisord'(http://supervisord.org/)来守护进程和管制瓶。例如,请参阅[本文](http://jamie.curle.io/blog/bottle-and-supervisord/)。 – 2014-10-01 06:21:02

回答

2

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

是的,我在守护进程模式下做了同样的事情。 – AshokGK 2014-11-02 07:45:41

相关问题