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 GeoIP
Why and when to use?
If you don’t mind installing and configuring official geoipupdate on your server then I’d recommend to use it. If you want a simple method to download db files via django command or schedule updates using celery then this app is the way to go.
Installation
Using pip:
pip install django-geoipdb-loader
Add the app to INSTALLED_APPS and configure GEOIP_PATH:
INSTALLED_APPS = [ ... geoipdb_loader, ... ] GEOIP_PATH = '/myproject/geoip'
Usage
Run manage.py download_geoipdb
to download geoip files.
By default GeoIP2 files are used for django 1.9+ and GeoIP files for django 1.8.
You can override db 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, hour=2, minute=32), }, }
or crontab:
32 2 * * 6 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.7.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ca762462a91727e4317699bd66efa9dbf9d34226daede95bd968ff9a41e3963 |
|
MD5 | 6d9480ccf84cad634ea6a6101abf5f03 |
|
BLAKE2b-256 | feec2c5a1b09ea69a5c331e81b5c122b3d3a546c27f8a01e9c7798e5340a7bc1 |