0

I am trying to capture the IP Address and the System Name of the current Login user during the login Process. I Use following code for the same:

import socket
system = socket.gethostname()
IPAddr = socket.gethostbyname(system)

It works fine in Local Server but when I push to Server it takes the server name and server IP instead of user IP.

Ibrahim Khan
  • 184
  • 10
  • Grab the ip from the header in the `request` object, see: https://stackoverflow.com/questions/4581789/how-do-i-get-user-ip-address-in-django – JSRB Jun 30 '22 at 13:33
  • @JSRB This method returns server IP/IP on which Website is Hosted. I want to get the client IP not Server IP – Ibrahim Khan Jul 04 '22 at 10:32

0 Answers0