This came up here: http://code.djangoproject.com/ticket/6648
I use flup to connect django to lighttpd via fastcgi. Upon startup, python seeds the pseudo random number generator to the system time (perhaps?). Using a forked worker model, every forked child process keeps the same seed and generates numbers from that.
Using
random.sample('ABCDEFGHIJKLMNOPQRSTUVWXYZ', 5)
in a view raises the following values:
{{
XDQIU AJMNL JIQXN XDQIU IROXL AJMNL YAPJL CUYOK ODKLA JIQXN WACZR IROXL CYUJE SNQLX YAPJL CUYOK UMOWL ODKLA PIXQG WACZR CYUJE
}}}.
The proposal would include re-seeding the pseudo random number generator in every child process directly after forking like this:
random.seed("%d%s" % (os.getpid(), time.ctime()))