title: Django : How to get client computer user name in view.py
body: <blockquote>
    <p>Server Setup  - Linux-CentOS7, Apache2.4, MySQL, Python3.6.8, Django2.2</p>
    
    <p>-</p>
    
    <p>Client OS - Windows10, Windows7, CentOS, MacOS ...</p>
    
    <p>Client Computer Hostname = MyPC_011 </p>
    
    <p>Client Computer logged in username = user-A</p>
  </blockquote>
  
  <p>In views.py I want to use client machine logged in username(user-A) when user access django website page.</p>
  
  <p>This is my view.py</p>
  
  <pre><code>def home_view(request):
      # Get IP address of client computer
      client_ip = request.META.get('REMOTE_ADDR')
  
      # Get Host Name of client computer
      client_host = request.META.get('REMOTE_HOST')
  
      return render(request, 'index.html')
  </code></pre>
  
  <p>I get IP address by REMOTE_ADDR,  REMOTE_HOST is empty, USER and USERNAME display server username.</p>
  
  <blockquote>
    <p>'GATEWAY_INTERFACE': 'CGI/1.1', 'SERVER_PORT': '8000', 'REMOTE_HOST': '', 'CONTENT_LENGTH': '', 'SCRIPT_NAME': '', 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'WSGIServer/0.2', 'REQUEST_METHOD': 'GET', 'PATH_INFO': '/', 'QUERY_STRING': '', 'REMOTE_ADDR': '192.168.5.107', '</p>
  </blockquote>
  
  <p>How to get client machine logged in username when user access django website page?</p>