<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def logout_with_message(request, msg, redirect=True, status='success'):
 """Send HttpResponseRedirect to LOGOUT_URL. `msg` is a message displayed on the login page after the logout, to explain the logout reason. """

    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