def getip(request):
 ip = request.META.get('HTTP_X_REAL_IP', '')
 if (not ip):
  ip = request.META.get('REMOTE_ADDR', 'None')
 return ip

def getip ( request ) : ip = request . META . get ( 'HTTP_X_REAL_IP' , '' ) if ( not ip ) : ip = request . META . get ( 'REMOTE_ADDR' , 'None' ) return ip
extract ip address of requester from header .