通过Apache modwsgi运行时如何制作Bottle打印stacktrace? [英] How to make Bottle print stacktrace when running through apache modwsgi?

查看:68
本文介绍了通过Apache modwsgi运行时如何制作Bottle打印stacktrace?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

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

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

app = Bottle()

Bottle构造函数没有任何调试参数.那我该怎么做才能获取堆栈跟踪信息?

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

推荐答案

import bottle
bottle.debug(True)

如果您查看源代码,则可以看到提供debugrun函数调用了此函数.

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

这篇关于通过Apache modwsgi运行时如何制作Bottle打印stacktrace?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆