def secure(view):
    """Set an auth decorator applied for views.
    If DEBUG is on, we serve the view without authenticating.
    Default is 'django.contrib.auth.decorators.login_required'.
    Can also be 'django.contrib.admin.views.decorators.staff_member_required'
    or a custom decorator.
    """
    AUTH = getattr(
        settings,
        'SLACKCHAT_AUTH_DECORATOR',
        'django.contrib.admin.views.decorators.staff_member_required'
    )
    auth_decorator = import_class(AUTH)
    return method_decorator(auth_decorator, name='dispatch')(view)