also get geolite ipv6 data
This commit is contained in:
parent
959479457d
commit
5222d706de
1 changed files with 8 additions and 0 deletions
|
@ -232,6 +232,14 @@ def update_geoip(force=False):
|
||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
os.unlink(path)
|
os.unlink(path)
|
||||||
os.system('gunzip "%s.gz"' % path)
|
os.system('gunzip "%s.gz"' % path)
|
||||||
|
path = os.path.join(settings.GEOIP_PATH, 'GeoLiteCityv6.dat')
|
||||||
|
if not os.path.exists(path) or force:
|
||||||
|
url = 'http://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz'
|
||||||
|
print 'download', url
|
||||||
|
ox.net.save_url(url, "%s.gz"%path)
|
||||||
|
if os.path.exists(path):
|
||||||
|
os.unlink(path)
|
||||||
|
os.system('gunzip "%s.gz"' % path)
|
||||||
|
|
||||||
def init():
|
def init():
|
||||||
if not settings.RELOADER_RUNNING:
|
if not settings.RELOADER_RUNNING:
|
||||||
|
|
Loading…
Reference in a new issue