Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

How it works with real example (with bigger project structure)? #37

Open
michaldev opened this issue Dec 13, 2022 · 2 comments
Open

How it works with real example (with bigger project structure)? #37

michaldev opened this issue Dec 13, 2022 · 2 comments

Comments

@michaldev
Copy link

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.

@michaldev
Copy link
Author

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'

@michaldev
Copy link
Author

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant