Replies: 1 comment
-
flask config or fastapi.state has django equivalent - django settings so if your "dict" is not modified by you processes and is a readonly - then settings.py / flast.config/ fastapi state is a perfect place to store it (if it's large just lazyload on first access) but if you dict is updated/modifed during run by multiple processes - you cannot use it (as for all instances it is per single process only) in that case you should use some shared state on top of redis for example |
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
-
Hi,
I am considering using Django Ninja for a relatively small app. To its core the app consists of two parts; a process that produces data based on the contents of a dictionary; and a process that modifies this dictionary. Both processes run in their own multiprocessing Process, and I want to use Django Ninja for the latter part.
However since both parts run in their own Process I need to use a multiprocessing manager to share the dict between the parts, and I am not sure how to connect the shared dict to the Django Ninja app. Flask has the .config dictionary and FastAPI has .state. I was wondering if Django Ninja has something similar?
If there are other ways of handling this, suggestions are also welcome.
Beta Was this translation helpful? Give feedback.
All reactions