美文网首页
Running a Bottle app with Gunico

Running a Bottle app with Gunico

作者: python都干了些什么啊 | 来源:发表于2019-03-02 11:42 被阅读0次

方法1:

#project.py
@route('/')
def index():
    return '<h1>Hello Bottle!</h1>'

#如果没有ssl证书,就去掉 certfile 和 keyfile 参数
run(host='127.0.0.1', port=8003, server='gunicorn', workers=4, certfile="my.crt", keyfile="my.key")
python project.py

方法2:

#project.py
@route('/')
def index():
    return '<h1>Hello Bottle!</h1>'

app = bottle.default_app()
gunicorn -w 4 hello_bottle:app

相关文章

网友评论

      本文标题:Running a Bottle app with Gunico

      本文链接:https://www.haomeiwen.com/subject/gnjzyqtx.html