A Django app that helps keep CartoDB tables synchronized with Django models.
Project description
A Django app that helps keep CartoDB tables synchronized with Django models.
Requirements
Django >= 1.8, cartodb-python, a CartoDB account.
Installation
Use pip.
Add to INSTALLED_APPS:
INSTALLED_APPS += ( 'cartodbsync', )
Then add the appropriate configuration details to your settings.
You will need some way of letting django-cartodb-sync about instances that need to be inserted, updated, or deleted. The simplest way is to use signals and the SyncEntry methods mark_as_pending_delete, mark_as_pending_insert, and mark_as_pending_update.
Finally, configure a cron job to run the cartodbsync management command. If you have existing model instances, mark all for insertion by running:
django-admin.py cartodbsync --markinsert
Configuration
Add the following to your settings:
CARTODB_SYNC = { 'API_KEY': '<your api key>', 'DOMAIN': '<your CartoDB domain>', 'MODELS': [ { 'CARTODB_TABLE': '<model CartoDB table>', 'MODEL_CLASS': '<example.Model>', 'SYNCHRONIZER_CLASS': '<example.Synchronizer>', } ] }
Everything between < and > should be replaced with appropriate details. You can list as many models as you like within the MODELS entry.
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-cartodb-sync-0.2.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b936c2341f8b88e3e1c77f247036f8faf949a204c786c23a86ba5510b62c41b5 |
|
MD5 | dbe977695462252e60fd056d3d182585 |
|
BLAKE2b-256 | 7254024c42ee8c40a825aa7ba69c11a7a81412af3e84eeb80f66c4697904cc92 |