CODESHIFT
Proudly
Presents

Flask with Werkzeug debugger on Google Appengine

Flask is a sweet little framework. It comes bundled with jinja2, werkzeug and nothing else. It works on GAE out-of-the box, but has a problem with werkzeug's awesome interactive debugger on the development server.

To fix the problem, you need this patch: werkzeug-debugger-appengine

Put it somewhere on the path, and then use it like this: 

    from werkzeug_debugger_appengine import get_debugged_app
    app.debug=True
    app = get_debugged_app(app)


So, the whole main.py file might look like this:
from wsgiref.handlers import CGIHandler

from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello_world():
    #foo
    return "Hello World!"

if __name__ == '__main__':
    
    from werkzeug_debugger_appengine import get_debugged_app
    app.debug=True
    app = get_debugged_app(app)
    
    CGIHandler().run(app)
2010-10-26 15:30 | comments
blog comments powered by Disqus