Trouble with handlers in flask-socketio that seem to work in python-socketio #1594
Unanswered
DerJungeDev
asked this question in
Q&A
Replies: 1 comment
-
The connect handler in Flask-SocketIO does not take any arguments. Remove sid and environ and you will be fine. |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
I was working with flask_socketio and I have been running into numerous obstacles. My working directory looks a little like
My very simple run .py is
My
__init__.py
looks likeroutes.py looks like
and the count.js which is linked through the count.html file
I keep getting errors saying that I implemented the connect event handler wrong, I don't have the arguments sid and environ (which I'm pretty sure I do), and other little issues
TypeError: connect() missing 2 required positional arguments: 'sid' and 'environ'
After watching Miguel's tutorials of python socketio on youtube, and reading through flask-sockectio documentation, I was able to implement the connect handler with (sid, environ) arguments but does not seem to work in flask-socketio
If anyone could help me or lead me to a tutorial or something where someone makes something with flask and socketio (preferably with a split up flask app like mine) I would highly appreciate it
Beta Was this translation helpful? Give feedback.
All reactions