当我尝试从瓶装标准服务器切换到带有SSL的cheroot并通过我获得的选项时:
Traceback (most recent call last):
File "C:/Users/kig0pkt12/PycharmProjects/dreadnought/main.py", line 9, in <module>
run(app, host='localhost', port=8080, debug=True, server='cheroot', options=options)
File "C:\WP36\python-3.6.2rc2.amd64\lib\site-packages\bottle-0.13.dev0-py3.6.egg\bottle.py", line 3713, in run
server.run(app)
File "C:\WP36\python-3.6.2rc2.amd64\lib\site-packages\bottle-0.13.dev0-py3.6.egg\bottle.py", line 3298, in run
server = wsgi.Server(**self.options)
TypeError: __init__() got an unexpected keyword argument 'options'
Snippet main.py:
from bottle import Bottle, run
app = Bottle()
options = {
'certfile':'cacert.pem',
'keyfile':'privkey.pem',
}
run(app, host='localhost', port=8080, debug=True, server='cheroot', options=options)
答案 0 :(得分:0)
好吧,看起来选项有所改变:
run(app, host='localhost', port=8080, debug=True, server="cheroot", certfile="cacert.pem", keyfile="privkey.pem")