'Log out the user for the given HttpRequest.
This should *not* assume the user is already logged in.'

@never_cache
def logout(self, request, extra_context=None):

    from django.contrib.auth.views import LogoutView
    defaults = {'extra_context': dict(self.each_context(request), has_permission=False, **(extra_context or {}))}
    if (self.logout_template is not None):
        defaults['template_name'] = self.logout_template
    request.current_app = self.name
    return LogoutView.as_view(**defaults)(request)
