我无法调试瓶子。我的开发中有 500 个错误。我正在使用最新的瓶子 debug=True 旗帜。

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

这就是我得到的......

Bottle v0.11.rc1 server starting up (using WSGIRefServer())...
Listening on http://localhost:8049/
Hit Ctrl-C to quit.

localhost - - [30/Sep/2012 18:59:13] "POST /bidder/ HTTP/1.1" 500 1407
localhost - - [30/Sep/2012 18:59:14] "POST /bidder/ HTTP/1.1" 500 1407
localhost - - [30/Sep/2012 18:59:14] "POST /bidder/ HTTP/1.1" 500 1407
localhost - - [30/Sep/2012 18:59:15] "POST /bidder/ HTTP/1.1" 500 1407
localhost - - [30/Sep/2012 18:59:15] "POST /bidder/ HTTP/1.1" 500 1407

只要我能找出原因,我不介意500?

有帮助吗?

解决方案

debug=False 中的关键字参数 run() 该功能仅在当前开发版本中可用;当前 0.10.x 代码本身 忽略 尚不支持。

相反,使用 debug() 功能 反而:

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

或运行 --debug 命令行标志。

您可能需要导入 debug 函数来自 bottle 如果您还没有这样做。教程解释了 更详细的调试模式.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top