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
Did you know?
The website is part of the attack surface, not only the API behind it. Every script, iframe, and tag on a public page is code that did not go through the same review as the backend.
Security insights from Cside
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#