2

当我尝试从 Bottlepy 标准服务器切换到使用 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'

片段 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)
4

1 回答 1

1

好吧,看起来选项改变了:

run(app, host='localhost', port=8080, debug=True, server="cheroot", certfile="cacert.pem", keyfile="privkey.pem")

于 2017-08-25T09:05:19.367 回答