The Python Oracle

Are global variables thread-safe in Flask? How do I share data between requests?

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Forest of Spells Looping

--

Chapters
00:00 Question
01:32 Accepted answer (Score 149)
03:25 Answer 2 (Score 53)
04:56 Answer 3 (Score 17)
05:48 Answer 4 (Score 11)
07:14 Thank you

--

Full question
https://stackoverflow.com/questions/3281...

Accepted answer links:
[multiprocessing.Manager]: https://stackoverflow.com/a/28426819
[g]: http://flask.pocoo.org/docs/1.0/api/#fla...

Answer 2 links:
https://pythonhosted.org/Flask-Session/

Answer 3 links:
[Flask-Caching]: https://flask-caching.readthedocs.io/en/...

Answer 4 links:
[as per Python documentation]: https://docs.python.org/3/glossary.html#...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #flask #threadsafety

#avk47