ceys / django-tracking

Automatically exported from code.google.com/p/django-tracking
MIT License
0 stars 0 forks source link

Use GeoDjango's Interface to GeoIP instead of MaxMind's GeoIP-Python #10

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Most people do not know that the Python interface to GeoIP is GPL-licensed,
which may prevent adoption by some projects.  In addition, most do not know
Django already has a built-in interface (using ctypes) to the GeoIP C
library that is mostly compatible with the GeoIP-Python interface.

GeoDjango's `GeoIP` class is loosely coupled, and does not require any of
the other GeoDjango prerequisites (e.g., no need to install geospatial
libraries like GEOS).

The following should substitute just fine:

>>> from django.contrib.gis.utils import GeoIP
>>> gip = GeoIP.open(geoip_data_file, GeoIP.GEOIP_MEMORY_CACHE)

However, I do not yet implement the `new` method, and would be willing to
take a look at doing so.

Original issue reported on code.google.com by jbr...@gmail.com on 10 Nov 2009 at 3:55

GoogleCodeExporter commented 8 years ago
I've finally updated the code to reflect this request!  Thanks!

Original comment by wheaties...@gmail.com on 27 Dec 2010 at 4:28