I\'ve been trying to find a more pythonic way of generating random string in python that can scale as well. Typically, I see something similar to
\'\'.join(r
import os random_string = os.urandom(string_length)
and if you need url safe string :
import os random_string = os.urandom(string_length).hex()
(note random_string length is greatest than string_length in that case)