1👍
Hostip.info is an open-source project with the goal to build/maintain a database mapping IP addresses to cities. Their about page explains the data sources relied on to populate this database.
Using HostIP, there are two ways to get location data from an IP address:
They also have a well-designed and easy-to-use RESTFUL API: just pass in your ip address after the ip= in the GET request string):
import urllib
response = urllib.urlopen('http://api.hostip.info/get_html.php?ip=12.215.42.19&position=true').read()
print(response);
1👍
You can try HTML5 geolocation or you can use Google Places providing an autocomplete address field which will return you details about the address given.
You can use geocomplete plugin to get the user address which uses Google Maps API and providing ease of access to have autocomplete and other features. Check the example here.
- [Answered ]-Django RegexValidator does not display message
- [Answered ]-Django queryset filter by post variable
- [Answered ]-Baffled by python __str__ method and unicode behaviour
- [Answered ]-Postgres select function in Django annotation
Source:stackexchange.com