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

def logout(self, request):

    from django.contrib.auth.views import logout
    defaults = {}
    if (self.logout_template is not None):
        defaults['template_name'] = self.logout_template
    return logout(request, **defaults)
