Running a Bottle app with Gunico

2019-03-02  本文已影响0人  python都干了些什么啊

方法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
上一篇下一篇

猜你喜欢

热点阅读