问题
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