Adding django-socketio to existing Apache / mod_wsgi / Django site

Can anyone provide a link or tutorial link for adding django-socketio functionality to an existing Django site that uses Apache and mod_wsgi?

Can they run in parallel or is the runerver_socketio command required to handle all requests?

This question is related but offers little practical information.



source to share

1 answer

You should be able to run a regular site behind an open source server like Apache, with the runerver_socketio part just serving web ports on a separate port. As described in the question you linked to, you will need to decide if proxies are possible through your webserver if necessary for you, but as also mentioned the gevent server used by the runerver_socketio server is more than capable.

When running separate instances like this, out of range functions will not work as they depend on shared state:

django_socketio.broadcast_channel(message, channel)
django_socketio.send(session_id, message)


You also need to add SOCKETIO_PORT

to your normal Django project options so that it knows which port to use.



All Articles