request.META.get('REMOTE_ADDR')
Dj Gilcrease
OpenRPG Developer
~~http://www.openrpg.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@google
I stumbled on this a while back. It may only work on Linux because of
the fcntl.
import socket
import fcntl
import struct
def get_ip_address(ifname):
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
return socket.inet_ntoa(fcntl.ioctl(
s.fileno(),
0x8915, # SIO
Ty wrote:
> I'd like to grab the users external IP address. I'm using it for a
> spam catching class that I'm porting over to Django/Python. Is this
> possible?
>
> This person outlines how to 'hack' it, but I'd rather not depend on an
> external site.
> http://dmiessler.com/blog/how-to-use-python-
I'd like to grab the users external IP address. I'm using it for a
spam catching class that I'm porting over to Django/Python. Is this
possible?
This person outlines how to 'hack' it, but I'd rather not depend on an
external site.
http://dmiessler.com/blog/how-to-use-python-to-get-your-external-i
4 matches
Mail list logo