Welcome to Serpia's blog!
Blog Entry
Get visitor's country
Get visitor's country from IP address
You want to know what country your website visitor is from, so you can automatically translate the page.Solution: I use CherryPy's request.remote_addr in this example to get the IP address of the client, but you can also use other tools like Python's os.environ["REMOTE_ADDR"] in combination with Python's cgi module. Secondly I use ip2country, you can get it here.
Comments
Post a comment