Python, bottle, and now to debug
Question
This is from the docs......
if __name__ == "__main__":
# Interactive mode
run(host='localhost', port=8049, debug=True)
This is the error I get. What did I miss?
Bottle server starting up (using WSGIRefServer(debug=True))...
Listening on http://localhost:8049/
Hit Ctrl-C to quit.
Shutdown...
Traceback (most recent call last):
File "/home/ubuntu/workspace/rtbopsConfig/rtbServers/rtbUwsgiBidderServer/uwsgiBidderServer.py", line 1239, in <module>
run(host='localhost', port=8049, debug=True)
File "/usr/local/lib/python2.7/dist-packages/bottle-0.10.11-py2.7.egg/bottle.py", line 2426, in run
server.run(app)
File "/usr/local/lib/python2.7/dist-packages/bottle-0.10.11-py2.7.egg/bottle.py", line 2123, in run
srv = make_server(self.host, self.port, handler, **self.options)
TypeError: make_server() got an unexpected keyword argument 'debug'
Solution
The debug=
parameter to run is only available since bottle version 0.11. Either update bottle (for example by simply downloading the up-to-date version, and placing it in the directory of your application), or remove debug=True
by replacing
run(host='localhost', port=8049, debug=True)
with
run(host='localhost', port=8049)
OTHER TIPS
For versions prior to 0.11, you can enable the debug mode by doing:
bottle.debug(True)
bottle.run(host='localhost', port=8049)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow