This post is partially close to what you want (excluding the java part and the later update on the post). The summary of the answer is that django is a muti-process environment, and thus sharing objects across sessions is not feasible. One option is to use the database for storing such shared objects.
shared memory in web application
-
09-10-2022 - |
Question
Hi I'm writing a web application using Django. I'm still learning the framework and reading the howto book. I know I might be asking this question prematurely however i'd really like to know. I want to create a python data structure in memory that is shared across all the sessions. What would be the best and most scalable way to perform this. So far I have read about redis however I would like to more flexibility and understand redis can only store strings instead of python objects..
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow