How do I server my Django application using gevent-socketio's SocketIOServer though Apache via uWSGI?
I have the following uWSGI .ini file:
[uwsgi]
socket = 127.0.0.1:3031
master = true
processes = 2
env = DJANGO_SETTINGS_MODULE=demo.settings
module = app:serve
then I have the following app.py
:
from gevent import monkey
from socketio.server import SocketIOServer
import django.core.handlers.wsgi
import os
import sys
monkey.patch_all()
PORT = 3031
os.environ['DJANGO_SETTINGS_MODULE'] = 'demo.settings'
def serve():
application = django.core.handlers.wsgi.WSGIHandler()
SocketIOServer(('', PORT), application, namespace="socket.io").serve_forever()
But it just keeps on loading, basically my problem is how do I tell uWSGI to use SocketIOServer when serving?