fastapi-socketio
fastapi-socketio copied to clipboard
How it works with real example (with bigger project structure)?
trafficstars
In my case, I have problem with import everything from main file (with fastapi app object). https://github.com/michaldev/problem-with-fastapi-import
Access to the app object is not required for other libraries.
I try like this: main.py: socket_manager.attach(app=app) sockets.py: socket_manager = SocketManager(app=None)
by returns AttributeError: 'NoneType' object has no attribute 'mount'
Solved. I used python-socketio instead of fastapi-socketio and I was able to connect a manager from main that is in a different file. This prevents circular imports.