Helps download and keep updated maxmind's geoip db required for django GeoIP
Project description
Helps download and keep updated maxmind’s geoip db required for django GeoIP2
Why and when to use?
If you don’t mind installing and configuring official geoipupdate binary on your server then I’d recommend to use it http://dev.maxmind.com/geoip/geoipupdate/ This app was designed for quick and easy setup of geoip updates via django settings.
Installation
Using pip:
pip install django-geoipdb-loader
Add the app to INSTALLED_APPS in settings file and configure GEOIP_PATH:
INSTALLED_APPS = [ ... geoipdb_loader, ... ] GEOIP_PATH = '/myproject/geoip'
Usage
Run manage.py download_geoipdb to download geoip files. By default for django 1.9+ geoip2 files are used, while for django 1.8 geoip files are used. You can set version in settings:
GEOIPDB_VERSION = 2 # 1 or 2
In order to automatically update the geoip files you can use provided celery task:
CELERYBEAT_SCHEDULE = { 'update-geoipdb': { 'task': 'geoipdb_loader.tasks.update_geoipdb', 'schedule': crontab(day_of_week=6), }, }
or crontab:
* * * * 7 manage.py download_geoipdb
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for django-geoipdb-loader-0.5.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74c9a30efbbaf96f3d379400dc34b740dfcadb5cab3718018c4be44a1c8ca1fd |
|
MD5 | a13c379975cae41ffe3ff2a02ac85c1f |
|
BLAKE2b-256 | aaa16e19cfc06d1b85b588f4a88f40a82444754946271971823a9c2b7e8c568d |