Skip to content

Instantly share code, notes, and snippets.

Created September 24, 2013 16:44
Show Gist options
  • Save anonymous/6687587 to your computer and use it in GitHub Desktop.
Save anonymous/6687587 to your computer and use it in GitHub Desktop.
Getting Flask Debug trace working while using gevent-socketio
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