Gevent with debug support for Flask
Using gevent server instead of the default one by flask will loose the debug feature, and this snippet will enable debugger and reload support.
from gevent.wsgi import WSGIServer
from werkzeug.serving import run_with_reloader
from werkzeug.debug import DebuggedApplication
app = Flask(__name__)
@run_with_reloader
def run_server():
http_server = WSGIServer(('', 5000), DebuggedApplication(app))
http_server.serve_forever()
run_server()
Written by Hsiaoming Yang
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Python
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#