Skip to main content

Sync environment

Project description

Management command to sync environment data.

Syncs database and media, for example when deploying an acceptance environment.

Quick Start

  • pip install django-datasync

  • add ‘datasync’ to INSTALLED APPS

  • configure settings

DATASYNC = {
    'HOST': '{{ remote_host_address }}',
    'PORT': {{ remote_ssh_port }}
    'USER': '{{ remote_username }}',
    'PASSWORD': '{{ remote_user_password }}',
    'MEDIA_REMOTE': '{{ remote_media_directory }}',
    'MEDIA_TARGET': '{{ local_media_directory }}',
    'DATABASE': {
        'HOST': '{{ db_host_address }}',
        'USER': '{{ db_username }}',
        'PASSWORD': '{{ db_password }}',
        'NAME': '{{ db_name }}',
        'PORT': {{ db_port }}
    },
}

You will now have access to the management command ‘sync_environment’. Run that command from the target machine, perhaps as a cron job. Or add to ansible-playbooks setup.

Supported Databases: Postgres.

You will also have to edit the following postgres conf file in order to allow access from your target machine(s)

/etc/postgresql/9.3/main/pg_hba.conf

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

datasync-0.0.1.dev0.tar.gz (3.0 kB view details)

Uploaded Source

File details

Details for the file datasync-0.0.1.dev0.tar.gz.

File metadata

File hashes

Hashes for datasync-0.0.1.dev0.tar.gz
Algorithm Hash digest
SHA256 b79a002a01db49f9e4256f10a7c126dc7acc48f778a36a9c067515d5f035b2df
MD5 c39571f35243bfec4cf995749b9d8573
BLAKE2b-256 9ae1a273546e7d19e152d2a515478088dd3b3b772563b1828fc2fe5122fe2595

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page