How to make Bottle print stacktrace when running through apache modwsgi?

风格不统一 提交于 2019-12-23 21:04:08

问题


When running Bottle as a standalone server it's very easy to do:

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'))

The problem is that with wsgi I have to do this:

app = Bottle()

And Bottle constructor doesn't have any debug parameter. So what can I do to get the stacktrace?


回答1:


import bottle
bottle.debug(True)

If you look at the source you can see that this function is called by the run function when providing debug.



来源:https://stackoverflow.com/questions/25572176/how-to-make-bottle-print-stacktrace-when-running-through-apache-modwsgi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!