Returns username maximum length as supported by Django.

    :rtype: int

def get_username_max_len():
    """Returns username maximum length as supported by Django.

    :rtype: int
    """
    fields = [field for field in USER._meta.fields if field.name == 'username']
    try:
        length = fields[0].max_length
    except IndexError:
        length = 30
    return length