Skip to content

Instantly share code, notes, and snippets.

@cescoferraro
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cescoferraro/dd5318a2085fb10f5254 to your computer and use it in GitHub Desktop.
Save cescoferraro/dd5318a2085fb10f5254 to your computer and use it in GitHub Desktop.
FLASK SOCKETIO V1.0 APP FACTORY PROBLEM
websocket/socket_controllers
SAME AS THE EXAMPLE, APART FROM THE OBJECT NAME (CESCO)
websocket/__init__.py
from flask import Blueprint
websocketio = Blueprint('websocket', __name__, url_prefix="/socket")
import app.websocket.socket_controllers
app/__init__.py
CESCO = SocketIO()
******inside create_app()
from app.websocket import websocketio
app.register_blueprint(websocketio)
CESCO.init_app(app)
manage.py
if __name__ == '__main__':
CESCO.run(app)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment