Forums

django geoip

There is error, when load http://kernie_xvid.pythonanywhere.com/ "Could not import rssDjApp.views. Error was: No module named geoip"

I have installed django-geoip through "pip install --user django-geoip" and there's correct paths to db's;

I think there's problem in C's library that needed for geoip.

Could you please install it?

Hi kernie_xvid,

In Django 1.3.* the import should be from django.contrib.gis.utils import GeoIP. However you are correct. It relies on a C libary that needs to be compiled. So even with the correct import it's not going to work at the moment. I did a little bit of work to see if it would install easily and it will not easily compile. So it is something that we will need to schedule for the future. In the mean time have you had a look at python-geoip? It looks like pure Python. Would that meet your requirements?

django-geoip easily works on my local machine (archlinux, C-library for geoip installs with "pacman"); with python-geoip I got some troubles

What is the exact name of the geoip c library? I couldn't find anything packaged for Debian.

Just to check there isn't some confusion here, I wonder if kernie_xvid is referring to this module, which appears to be a geolocation library based on a back-end covering primarily Russian addresses, and hansel is referring to this, which appears to be a BSD-licensed interface to the popular MaxMind geolocation database. Just a guess, thought it was worth clarifying.

These appear to be completely separate and based on different data sets. However, glancing through the docs for that second library, it's not clear to me the C library/libraries on which it depends.