Skip to content
Advertisement

Tag: flask-socketio

Can I handle POST requests to Flask server in background thread?

I know how to receive data from POST request in main thread: But can I do that in background thread to avoid blocking UI (rendering index.html)? Answer I’m assuming you want the html rendering and processing of your request to run concurrently. So, you can try threading in Python https://realpython.com/intro-to-python-threading/. Let say you have a function that performs some processing

flask web socket not connecting

i am trying to connect websocket in flask(1.1.2) with Flask-SocketIO(5.0.1) but it give 400 error to websocket url. i`m using anaconda virtual environment. my requirements.txt is – amqp==5.0.3, bidict==0.21.2, certifi==2020.12.5,click==7.1.2, dnspython==1.16.0, eventlet==0.30.0, Flask==1.1.2, Flask-SocketIO==5.0.1, gevent==21.1.1, gevent-websocket==0.10.1, greenlet==1.0.0, importlib-metadata==3.4.0, itsdangerous==1.1.0, Jinja2==2.11.2, kombu==5.0.2, MarkupSafe==1.1.1, python-engineio==4.0.0, python-socketio==5.0.4, six==1.15.0, typing-extensions==3.7.4.3, vine==5.0.0, Werkzeug==1.0.1, zipp==3.4.0, zope.event==4.5.0, zope.interface==5.2.0 Answer It’s because of version compatibility, you should either

Advertisement