【问题标题】:How to make Bottle print stacktrace when running through apache modwsgi?通过apache modwsgi运行时如何使Bottle打印堆栈跟踪?
【发布时间】:2014-10-23 16:41:45
【问题描述】:

将 Bottle 作为独立服务器运行时,这很容易做到:

from bottle import run, Bottle

run(app=app, host=config.get('bottle_host', 'localhost'), port=config.get('bottle_port', '8080'),
                            debug=config.get('debug', True), server=config.get('server_middleware', 'tornado'))

问题是使用 wsgi 我必须这样做:

app = Bottle()

Bottle 构造函数没有任何调试参数。那么我该怎么做才能获得堆栈跟踪呢?

【问题讨论】:

    标签: python apache mod-wsgi wsgi bottle


    【解决方案1】:
    import bottle
    bottle.debug(True)
    

    如果您查看源代码,您可以看到在提供debug 时,该函数是由run 函数调用的。

    【讨论】:

    • 在文档中提到here
    猜你喜欢
    • 2015-07-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-12-31
    • 1970-01-01
    • 1970-01-01
    • 2018-07-06
    相关资源
    最近更新 更多