nl: and settings.SECRET_KEY, call on it method encode with an argument string 'utf-8', use the result as an argument for the call to the method hashlib.sha256, call the method digest on the result, use the result as an argument for the call to the function random.seed. call the function random.choice with an argument allowed_chars, for every i in range of integers from 0 to lengths,
code: return '' . join ( random . choice ( allowed_chars ) for i in range ( length ) )