Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
565 views
in Technique[技术] by (71.8m points)

python - Flask Interactive Debugger Broken

I'm trying to figure out why the Flask interactive debugger isn't working. My template application is barebones, with a single error:

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)

But the debugger catches the error, but gives me a non-interactive page and complains about a lack of 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.

I haven't disabled Javascript, so I'm not sure why this the interactive debugger is broken. Thanks!

Edit: I'm running this on a remote host and viewing this over an SSH tunnel. Is it possible that Javascript is disabled in this way?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The solution was that none of the static files provided by the debugger as part of the Werkzeug suite were being found. Simply uninstalling/reinstalling Flask and Werkzeug fixed this issue. Thanks for everyone who answered!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...