def ip_address_from_request(request):
    """Returns guest's IP address. This may be complicated by proxies.
    Source: https://stackoverflow.com/q/3759981/1093087"""
    # Source: https://stackoverflow.com/a/25040332/1093087
    remote_addr = request.environ.get('REMOTE_ADDR')

    if remote_addr:
        return remote_addr
    else:
        # Source: https://stackoverflow.com/a/26654607/1093087
        return request.environ.get('HTTP_X_REAL_IP', request.remote_addr)