I always forget stuff, so I’ll start to post my snippet here. Generate n length random string 1 2 3 4 5 6 import random def random_string(n): """ Create n length random string """ code = ''.join([random.choice('abcdefghijklmnoprstuvwyxzABCDEFGHIJKLMNOPRSTUVWXYZ0123456789') for i in range(n)]) return code Related posts: Django Tutorial – Simple Notes Application Handling 404 Page [...]
Related posts:
↧