Code:
ip_addr = request.environ['REMOTE_ADDR']
print(f'ipaddr --> {ip_addr}')
print(request.environ.get('HTTP_X_FORWARDED_FOR' , request.remote_addr))
print(f'Remote Addr --> {request.remote_addr}' )
I try all this in order to get the client ip-addr but don't know why there locahost is coming.
Please Elaborate and guide.