方法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
网友评论