N
N
nixxx2019-05-13 16:13:02
Flask
nixxx, 2019-05-13 16:13:02

How to run Flask + socketio + gunicorn?

Good afternoon. Tell me, please, one moment.
Simplified folder structure:

app/
   __init__.py
app.py

app.py
from app import app
from app import socketio

socketio.run(app, "127.0.0.1", 8000)

__init__.py
from flask import Flask
from flask_socketio import SocketIO

app = Flask(__name__)
app.config.from_object('config.Config')
async_mode = None
socketio = SocketIO(app, async_mode=async_mode,  logger=True, engineio_logger=True)

This is how it works : python app.py
This is not how it works : gunicorn --worker-class eventlet -w 5 app:socketio
How to run flask through gunicorn?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question