1. R = request.META  
  2. Ip_address=(R.get('HTTP_X_FORWARDED_FOR','') or R.get('REMOTE_ADDR','')).split(',')[0]