Backup, Sync and Restore Databases and Media
Project description
Django sync env
django-sync-env is a Django app to manage backing up and restoring django databases and media assets easy.
Detailed documentation is in the "docs" directory. (needs some work)
Requirements:
- configurable backups and restore which can be ran on demand, celery cron or in dev.
- support s3 bucket and file storage options first, add azure blob storage later
- interactive prompts for local dev
- command line options with --no-input for CICD and automations
- restore latest option for media and backups for X env
- backup before restore option
TODO:
- update docs around how to development this package
- remove command options which we wont use
- make sure all management commands work will good error logging and handling
Quick start
- Add "django_sync_env" to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [
...,
"django_sync_env",
]
- Configure the app via a settings file .typically
./settings/partial/sync_env.py
for base configuration, don't forget to import this file via your base.py settings file And override any required settings per environment via./settings/partials/[env].py
see example_partials
There is a s3 terraform example for provisioning an aws s3 bucket, iam user, roles and policy to allow for remote backup/restore to/from a secure s3 bucket.
See management commands for more details for each of the commands available.
./manage.py sync_env_backup_db
./manage.py sync_env_backup_media
./manage.py sync_env_restore_db
./manage.py sync_env_restore_media
./manage.py sync_env_list_backups
Publish package
prerequisites : Docker
To release a new version of this package create a .env file at the root of this repo
POETRY_PYPI_TOKEN_PYPI=<KEY>
add our pypi api key and then run.
$ ./publish.sh
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
django_sync_env-0.2.2b0.tar.gz
(19.9 kB
view hashes)
Built Distribution
Close
Hashes for django_sync_env-0.2.2b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 842862b91f61b5f264719c3f238b20135fcdce9b4c41ef2aaab5fbda615cc112 |
|
MD5 | 8177ba4a65111955b5cbdefe7a849d6d |
|
BLAKE2b-256 | d7147da3d3d59622c4a8f3172fb29e4aa7160943c11f576887c73922e6a9c7ab |