add geo info to user table

This commit is contained in:
j 2011-12-03 17:17:07 +01:00
commit 3de8bbe367
5 changed files with 65 additions and 1 deletions

View file

@ -100,6 +100,14 @@ def update_static():
if not os.path.exists(image):
shutil.copyfile(pandora, image)
#download geo data
path = os.path.join(settings.GEOIP_PATH, 'GeoLiteCity.dat')
if not os.path.exists(path):
url = 'http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz'
print 'download', url
ox.net.saveUrl(url, "%s.gz"%path)
os.system('gunzip "%s.gz"' % path)
def init():
load_config()
thread.start_new_thread(reloader_thread, ())