python – Flask Interactive Debugger Broken

前端之家收集整理的这篇文章主要介绍了python – Flask Interactive Debugger Broken前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我试图找出Flask交互式调试器无法正常工作的原因.我的模板应用程序是准系统,只有一个错误
from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello_world():
    print missing_variable #Error
    return 'Hello World!'

if __name__ == '__main__':
    app.run(host='0.0.0.0',debug=True)

但调试器捕获错误,但给了我一个非交互式页面,并抱怨缺少Javascript:

The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error. If you enable JavaScript you can also use additional features such as code execution (if the evalex feature is enabled),automatic pasting of the exceptions and much more.

我没有禁用Javascript,所以我不确定为什么这个交互式调试器坏了.谢谢!

编辑:我在远程主机上运行它并通过SSH隧道查看.是否有可能以这种方式禁用Javascript?

解决方法

解决方案是,调试器作为Werkzeug套件的一部分提供的静态文件都没有找到.只需卸载/重新安装Flask和Werkzeug即可解决此问题.谢谢大家的回答!

猜你在找的Python相关文章