Problems on Deploy #960
Unanswered
carlosevi94
asked this question in
Q&A
Replies: 1 comment 1 reply
-
@carlosevi94 Are you reading the python-socketio documentation? There is a lot of information regarding deployment there that you appear to not know about. I also recommend you look at the Flask-SocketIO documentation, which includes an example nginx configuration file, which will work exactly the same for your Django project. Finally, my understanding is that |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
I'm trying to deploy my Django project on a ubuntu server for prepare the production version. But deploy its beeing so complicate. I have few experience deploying normal Django apps, but no experience with complex apps likes app with websockets or something.
On my local enviroment I have django with eventlet for capture the disconnect events on real time (its important for this project). For server side, first I tried with nginx + gunicorn but gunicorn throw a lots of problems, so I changed to nginx + django runserver.
I'm going to describe my problem:
When I deploy the code in the server, websocket no works, only polling request. Actually I don't know if this is caused by a wrong server configuration or a client problem.
When I use this method for connect
var socket = io.connect()
and I start a socket.io client connection, on my firefox shell, I see this errorPolling request works and return
200 OK
messages. On my development enviroment I don't see that error.But if I use this method
var socket = io.connect('http://my_ip_server', { transports: ["polling"] });
I don't see the error above (logicaly, I'm specifying to not use websocket) and the app works like on my local, but disconnect event is not catched on realtime (logicaly too).I didn't find so many info about nginx + django + socket.io server deployment info, so I used a basic config for start. My nginx conf for this site is this
I tryed too this another conf but the result is the same.
I don't know if socket.io need another ports open and that is problem. I don't think it because I specified the port on wsgi.py with this lane
What could be the problem??
Thanks for read!
versions
SO Server: Ubuntu 22.04
SO Local: Ubuntu 20.04
Server Python 3.8.13
Local Python: 3.8.10
And the the 4.5.0 of socket.io for js client.
Beta Was this translation helpful? Give feedback.
All reactions