Created
September 24, 2013 16:44
-
-
Save anonymous/6687587 to your computer and use it in GitHub Desktop.
Getting Flask Debug trace working while using gevent-socketio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from gevent import monkey | |
from socketio.server import SocketIOServer | |
from flask import Flask, request, render_template | |
from werkzeug.debug import DebuggedApplication | |
monkey.patch_all() | |
app = Flask(__name__) | |
app.debug = True | |
@app.route('/') | |
def index(): | |
pass | |
@app.route('/socket.io') | |
def socketio(): | |
app.log.debug("here") | |
return | |
if __name__ == '__main__': | |
app = DebuggedApplication(app, evalex=True) | |
SocketIOServer(('127.0.0.1', 8080), app, namespace="socket.io", policy_server=False).serve_forever() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment