+def get_random_string(length=12,
+ allowed_chars='abcdefghijklmnopqrstuvwxyz'
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'):
+ from random import SystemRandom
+ random = SystemRandom()
+ return ''.join(random.choice(allowed_chars) for i in range(length))
+
+