Skip to content

Commit

Permalink
use maxmind v2 db format if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
cezio committed May 8, 2018
1 parent 602e1a0 commit 38db65e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion geonode/base/management/commands/updategeoip.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@

logger = logging.getLogger(__name__)

URL = 'http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz'
try:
from django.contrib.gis.geoip2 import GeoIP2 as GeoIP
URL = 'http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz'
except ImportError:
from django.contrib.gis.geoip import GeoIP
URL = 'http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz'


class Command(BaseCommand):
Expand Down

0 comments on commit 38db65e

Please sign in to comment.