Updating GeoIP database¶
django-geoip supports only ipgeobase.ru backend.
To update your database with fresh entries (adds new geography and completely replaces all IpRegions with fresh ones):
python manage.py geoip_update
This is irreversible operation, do not use on production!
If you wish to clear all geodata prior the sync (deletes all Cities, Regions, Countries and IpRanges):
python manage.py geoip_update --clear
New in version 0.3.1: To reduce the size of indexes and database you can exclude countries from import. It’s achieved by specifying only needed county codes in settings:
IPGEOBASE_ALLOWED_COUNTRIES = ['RU', 'UA']
If you’re having
2006, 'MySQL server has gone away' error during database update,
max_allowed_packet to a higher value might help.