def random_code_generator():
 code_length = getattr(settings, 'REGISTRATION_CODE_LENGTH', 8)
 return generate_random_string(code_length)

def random_code_generator ( ) : code_length = getattr ( settings , 'REGISTRATION_CODE_LENGTH' , 8 ) return generate_random_string ( code_length )
generate a random alphanumeric code of length defined in registration_code_length settings .