代码之家  ›  专栏  ›  技术社区  ›  Tampa

Python、bottle和现在要调试

  •  1
  • Tampa  · 技术社区  · 13 年前

    这是来自文件。。。。。。

    if __name__ == "__main__":
        # Interactive mode
        run(host='localhost', port=8049, debug=True)
    

    这就是我犯的错误。我错过了什么?

    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'
    
    2 回复  |  直到 13 年前
        1
  •  6
  •   Anton Beloglazov    13 年前

    对于0.11之前的版本,您可以通过执行以下操作来启用调试模式:

    bottle.debug(True)
    bottle.run(host='localhost', port=8049)
    
        2
  •  5
  •   phihag    13 年前

    这个 debug= 要运行的参数仅可用 since 瓶子版本0.11。更新瓶子(例如 downloading the up-to-date version ,并将其放置在应用程序的目录中),或删除 debug=True 通过替换

    run(host='localhost', port=8049, debug=True)
    

    具有

    run(host='localhost', port=8049)