Adding Socket.IO to an existing Django / WSGI project

This guy seems to be trying to do the same, but the answer to his question is not clear enough. I'm not all familiar with setting up socket servers, so I'm still a little lost here. Has anyone done this before? How do you deploy and maintain a socket server?

I wanted to comment on his post and ask him if he has any success, but I don't have enough reputation yet.


source to share

2 answers

My final solution for this was to use a built in command runserver_socketio

for a

script running on

. I am using Ubuntu, so I made an upstart config to support it. It seems to work pretty well, working alongside my Apache / WSGI server. If anyone has a better solution please do speak.



The approach I came up with was using wsgi, which apache uses for a thread instance, which just calls the runerver_socketio command. This is, of course, the best approach. But if someone finds a better solution. Let us know in this post.

def init_socketio():
    os.system('python runserver_socketio')

socketio_thread = Thread(target=init_socketio, args=())




All Articles