django-admin-honeypot
django-admin-honeypot copied to clipboard
Why honeypot doesn't track the location from IP Address?
This plugin is verry usefull, but why doesn't track the location? as an example by using the GeoIP with pygeoip and track the city, or else...
>>> gi = pygeoip.GeoIP('GeoIPCity.dat')
>>> gi.record_by_addr('64.233.161.99')
{
'city': u'Mountain View',
'region_code': u'CA',
'area_code': 650,
'time_zone': 'America/Los_Angeles',
'dma_code': 807,
'metro_code': 'San Francisco, CA',
'country_code3': 'USA',
'latitude': 37.41919999999999,
'postal_code': u'94043',
'longitude': -122.0574,
'country_code': 'US',
'country_name': 'United States',
'continent': 'NA'
}
>>> gi.time_zone_by_addr('64.233.161.99')
'America/Los_Angeles'
Sounds like a great idea @agusmakmun. Can you submit a pull request?
hello @pydanny, can you suggest me to save this value of record_by_addr? by using models.TextField or what?
#42 pull request
It should be noted that the free version of the MaxMindDBs are discontinued as of January 1, 2019. See here: https://support.maxmind.com/geolite-legacy-discontinuation-notice/
@mkoistinen any mean that using ip2location lite to replace maxmind in django ?
Could be. Looks like they have a Python library, should be easy enough to use that.
For what it is worth, only the GeoLite Legacy databases will be discontinued. The GeoLite2 databases will continue to be provided. The geoip2 module supports GeoLite2.