django-admin-honeypot icon indicating copy to clipboard operation
django-admin-honeypot copied to clipboard

Why honeypot doesn't track the location from IP Address?

Open agusmakmun opened this issue 8 years ago • 7 comments

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'

agusmakmun avatar Nov 25 '16 12:11 agusmakmun

Sounds like a great idea @agusmakmun. Can you submit a pull request?

pydanny avatar Feb 17 '17 21:02 pydanny

hello @pydanny, can you suggest me to save this value of record_by_addr? by using models.TextField or what?

agusmakmun avatar Feb 18 '17 07:02 agusmakmun

#42 pull request

agusmakmun avatar Feb 18 '17 11:02 agusmakmun

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 avatar Jun 02 '18 17:06 mkoistinen

@mkoistinen any mean that using ip2location lite to replace maxmind in django ?

m-cameron avatar Jun 03 '18 08:06 m-cameron

Could be. Looks like they have a Python library, should be easy enough to use that.

mkoistinen avatar Jun 03 '18 14:06 mkoistinen

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.

oschwald avatar Jun 03 '18 22:06 oschwald