def get_client_ip(request):
 if ('HTTP_X_REAL_IP' in request.META):
  if (request.META['REMOTE_ADDR'] not in atc_api_settings.PROXY_IPS):
   raise ValueError('HTTP_X_REAL_IP set by non-proxy')
  return request.META['HTTP_X_REAL_IP']
 else:
  return request.META['REMOTE_ADDR']

def get_client_ip ( request ) : if ( 'HTTP_X_REAL_IP' in request . META ) : if ( request . META [ 'REMOTE_ADDR' ] not in atc_api_settings . PROXY_IPS ) : raise ValueError ( 'HTTP_X_REAL_IP set by non-proxy' ) return request . META [ 'HTTP_X_REAL_IP' ] else : return request . META [ 'REMOTE_ADDR' ]
return the real ip of a client even when using a proxy .