allowed_chars = ''.join((string.lowercase, string.uppercase, string.digits))
unique_id = ''.join(random.choice(allowed_chars) for _ in range(32))
unique_id
Django package to generate random alphanumeric string