5
votes

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?

2
Your code works fine for me (except for the extra . at the end of 0.0.0.0.) What browser, version of Flask, version of python, and OS are you on? - korylprince
Yes, this baffles me. I've tried the stable versions of Firefox, Chrome, without extensions, on OSX 10.8.4. @korylprince - Chris
Same story here: I can run this fine once the period is fixed. What does the HTML source that you receive look like? - Mark Hildreth
@MarkHildreth I've uploaded the debugger HTML here: pastebin.com/EcM13QPm - Chris
Is there anything in the javascript console? F12? - Markus Unterwaditzer

2 Answers

3
votes

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!

0
votes

you're running on 0.0.0.0. take out the last period