python 在生产服务器上运行时显示烧瓶回溯

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python 在生产服务器上运行时显示烧瓶回溯相关的知识,希望对你有一定的参考价值。

import traceback

@app.errorhandler(500)
def internal_error(exception):
    """Show traceback in the browser when running a flask app on a production server.

    By default, flask does not show any useful information when running on a production server.
    By adding this view, we output the Python traceback to the error 500 page.
    """
    trace = traceback.format_exc()
    return("<pre>" + trace + "</pre>"), 500

以上是关于python 在生产服务器上运行时显示烧瓶回溯的主要内容,如果未能解决你的问题,请参考以下文章