I am using Django 1.5.5.
settings.py:
GEOIP_PATH = os.path.join(PROJECT_DIR, 'geoIP') INSTALLED_APPS = (..,'django.contrib.gis',..)
views.py:
from django.contrib.gis import geoip print geoip.HAS_GEOIP
print gives false .
If I try to do one of the following, I get ImportError: cannot import name GeoIP
from django.contrib.gis.utils import GeoIP #this one is deprecated whatsoever from django.contrib.gis.utils.geoip import GeoIP #this one is deprecated whatsoever from django.contrib.gis.geoip import GeoIP
Typically, it looks like this: geoip does not contain a geoip module.
Also, if I open python in the terminal:
>>> from django.contrib.gis.geoip import GeoIP Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: cannot import name GeoIP
Additional information if I print:
from django.contrib.gis import geoip print geoip
I get:
<module 'django.contrib.gis.geoip' from '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/gis/geoip/__init__.pyc'>
Not sure if this could be a clue for someone who can help me?
python django
Diolor
source share