In Django 1.7, I want a set of random numbers to be created each time my website is visited. To do this, I make the random numbers in my views.py
file, in global scope. In this way, the random numbers are generated the first time the user loads the website and views.py
is run.
However, if somebody has already visited my website, and then refreshes in the address bar to go back to the homepage, then these random numbers are never regenerated. So, the user is stuck with their old set of numbers.
Why are the commands in views.py
only processed the first time? Is it possible to still have the random number generation in global scope, whilst also being called each time the address bar is refreshed?