简体   繁体   中英

bottlepy throws TypeError after changing server to cheroot

When I tried to switching from the bottlepy standard server to cheroot with SSL and pass options I got:

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)

好吧,看起来选项已更改:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM