def get_ip_address(request):
    """
    Get IP address from the specified request. This should handle
    proxy requests.
    :param request:
    :return:
    """
    headers = ('HTTP_X_REAL_IP', 'HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'REMOTE_ADDR')
    for header in headers:
        ip = request.META.get(header)
        if ip:
            return ip.split(",")[0].strip()