Oh, so this could be an issue too: what if the value in local_settings is False, but the default_val is True? Probably safer to do:

    if hasattr(local_settings, setting_name):
        return getattr(local_settings, setting_name)
    else:
        return default_val