def get_ip_address_from_request(request):
    """ Makes the best attempt to get the client's real IP or return
        the loopback """
    remote_addr = request.META.get('REMOTE_ADDR', '')
    if remote_addr and is_valid_ip(remote_addr):
        return remote_addr.strip()
    return '127.0.0.1'
def get_ip_address_from_request ( request ) : remote_addr = request . META . get ( 'REMOTE_ADDR' , '' ) if remote_addr and is_valid_ip ( remote_addr ) : return remote_addr . strip ( ) return '127.0.0.1'
Makes the best attempt to get the client's real IP or return
        the loopback