def is_safe_attribute(self, obj, attr, value):
    'Test if attribute is safe.'
    if isinstance(obj, (AllStates, DomainStates, TemplateState)):
        return (attr[0] != '_')
    if isinstance(obj, Namespace):
        return True
    return super().is_safe_attribute(obj, attr, value)
Test if attribute is safe.
def is_safe_attribute(self, obj, attr, value):
    
    if isinstance(obj, (AllStates, DomainStates, TemplateState)):
        return (attr[0] != '_')
    if isinstance(obj, Namespace):
        return True
    return super().is_safe_attribute(obj, attr, value)