How to store state in the app? #1859
Replies: 2 comments 6 replies
-
Yes, I have basically the same question. I think currently it boils down to storing that in a global symbol somewhere but that only works if the settings are immutable. Using connexion's scope could be another solution but that is only available after all middlewares did run (#1750). |
Beta Was this translation helpful? Give feedback.
-
Are you asking about static configuration that gets read at startup, or something else? My Connexion projects all use Flask, and all use the Flask configuration feature, basically slurp in a series of Are you asking if you can change the contents of the config dict /after/ startup? I would have to try, I don't know if the Flask config object becomes immutable. |
Beta Was this translation helpful? Give feedback.
-
On startup, I'd like to store custom state inside the app (like settings) which is also available outside of the context of a request. How would I do that? I noticed that the mechanism from Starlette (via
app.state
) seems not to be available.Beta Was this translation helpful? Give feedback.
All reactions