I have a very big python list ( ~ 1M strings) defined in a .py file. I import it in my views.py to access the list in my views.
My question is does the list gets loaded in RAM for every user coming to the web app, or does it loads just one single time and is used for all users ?
I have a very big python list ( ~ 1M strings) defined in a
Share
A Django process is loaded once and remains active to handle incoming requests. So if you define the list as a global variable, it stays in RAM and all is fine. It is discouraged to manipulate the list though.