views:

92

answers:

1

Hi,

I am using the Flask micro-framework (based on Werkzeug) which uses Python (2.6 in my case).

I'm making a website where users can log on and download files.

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?


I apologize for the lack of code. Thank you in advance :-)

+2  A: 

See the documentation on how to access the Request object here and then get from this same Request object, the attribute remote_addr, for more information see this documentation of Werkzeug.

Tarantula
Great, thank you. I was struggling to get my head around it all.
Jonathan