Hi, I would like to know how I could use Blueprints with flask-socketio. I would like to keep all the socket handlers in a separate module and I believe this can be done using blueprints in flask. However, I haven't been able to accomplish this and there aren't sufficient resources to help me with this. Could you kindly help me how this can be achieved?
The following example application demonstrates how to structure a larger app that has blueprints:
Thank you. Its working like a charm now!
Thank you to miguelgrinberg.
O exemplo de aplicativo a seguir demonstra como estruturar um aplicativo maior que possui projetos:
How to add the CORS configuration? Because using a single file without a blueprint, I configure it as follows:
socketio = SocketIO(app, cors_allowed_origins="*")
Taking advantage of the context, how do I make flask_socketio work together with pyngrok? The server runs normally when I'm on the local network, but when I try to connect to the public network the client is disconnected.
@engmsilva the arguments that you pass to the SocketIO class can also be passed on the socketio.init_app() call when you use an app factory function and blueprints.
I just tested an example app and can confirm that WebSocket does not appear to work. Not sure what I can do about it, but I'll see if I can find someone to discuss this with.
Is it possible to use a package of flask_socekitio functions , as a blueprint inside a big flask project such as Miguel's mega tutorial microblog ?
@yyyasmin Look at the Flask-SocketIO-Chat project for an example of how to structure a large app with Socket.IO.
Hi miguel
Thanks for your reply. I've Seen this project as an answer for somebody's
else's question. But would you please explain it as you did in your Mega
Tutorial?
Thankyou Yasmin
יסמין עמראן
תכנות , טיפול וחינוך מיוחד
On Fri, Oct 30, 2020 at 1:14 AM Miguel Grinberg notifications@github.com
wrote:
@yyyasmin https://github.com/yyyasmin Look at the Flask-SocketIO-Chat
https://github.com/miguelgrinberg/Flask-SocketIO-Chat project for an
example of how to structure a large app with Socket.IO.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/miguelgrinberg/Flask-SocketIO/issues/64#issuecomment-719076056,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AEWZOA7VHIFOZEM5WXQTGG3SNHZO7ANCNFSM4AWKWASA
.
@yyyasmin the project I referenced is not part of a written tutorial, it is a standalone project intended for users to study on their own.
can you shoe me an exampke of a sixjetio function insude a regular flask
project ( that is run by fkask and bot bu socketio )?
On Sat, 31 Oct 2020, 12:54 Miguel Grinberg, notifications@github.com
wrote:
@yyyasmin https://github.com/yyyasmin the project I referenced is not
part of a written tutorial, it is a standalone project intended for users
to study on their own.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/miguelgrinberg/Flask-SocketIO/issues/64#issuecomment-719917488,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AEWZOA4HLBYCYPNWU5QHEBLSNPUIFANCNFSM4AWKWASA
.
@yyyasmin that is what the example I directed you to does.
Most helpful comment
The following example application demonstrates how to structure a larger app that has blueprints:
https://github.com/miguelgrinberg/Flask-SocketIO-Chat