code: def logout_with_message(request, msg, redirect=True, status='success'):
      
      logout(request)
      if redirect:
          response = http.HttpResponseRedirect(
              '%s?next=%s' % (settings.LOGOUT_URL, request.path))
      else:
          response = http.HttpResponseRedirect(settings.LOGOUT_URL)
      add_logout_reason(request, response, msg, status)
      return response
docs: Send HttpResponseRedirect to LOGOUT_URL.
  
      `msg` is a message displayed on the login page after the logout, to explain
      the logout reason.