I'm making a website where users can log on and download files, using the Flask micro-framework (based on Werkzeug) which uses Python (2.6 in my case).
I need to get the IP address of users when they log on (for logging purposes).
Does anyone know how to do this? Surely there is a way to do it with Python?
Best Answer
See the documentation on how to access the Request object and then get from this same Request object, the attribute
remote_addr
.Code example
For more information see the Werkzeug documentation.