code: def get_client_ip(request):
      
      _SECURE_PROXY_ADDR_HEADER = getattr(
          settings, 'SECURE_PROXY_ADDR_HEADER', False
      )
      if _SECURE_PROXY_ADDR_HEADER:
          return request.META.get(
              _SECURE_PROXY_ADDR_HEADER,
              request.META.get('REMOTE_ADDR')
          )
      return request.META.get('REMOTE_ADDR')
docs: Return client ip address using SECURE_PROXY_ADDR_HEADER variable.
  
      If not present or not defined on settings then REMOTE_ADDR is used.
  
      :param request: Django http request object.
      :type request: django.http.HttpRequest
  
      :returns: Possible client ip address
      :rtype: string