Django package for backing up databases.
Project description
Django backups
A django backup package for backing up your databases.
Installation
NOTE: Before installing this package, you should have postgresql installed on your machine.
Install through pip
pip install django-backups
In settings.py, add the following line:
BACKUP_DIR = BASE_DIR / "backups_folder"
This is where your saved backups will go locally.
Add backups
to INSTALLED_APPS.
INSTALLED_APPS = [
...
'backups',
]
Add those two lines in settings.py:
from dotenv import load_dotenv
load_dotenv()
Add the following lines to .env
file:
DO_SPACE_ACCESS_KEY_ID='<key_id>'
DO_SPACE_SECRET_ACCESS_KEY='<secret_access_key>'
DO_SPACE_ENDPOINT_URL='<endpoint_url>'
DO_SPACE_BUCKET_NAME='<bucked_name>'
DO_SPACE_REGION='<s3_region>'
Include the urls in your project/urls.py
:
from django.urls import path, include
urlpatterns = [
# ...
path('', include('backups.urls'))
]
NOTE: Don't worry about DO_SPACE
, it'll work with S3 in general.
Before running the server, make sure to do python manage.py migrate
Integration with Celery
By default, if you've already installed celery in your project, the tasks will be load to Celery, just make sure it's up and running.
TODO
-
store credentials for Servers and tables.
-
Actions for:
- Servers:
- Check server connection (even before storing server info).
- Get server databases and store them
- Backup all databases.
- Databases:
- Update all tables
- Backup database.
- Servers:
-
Backup:
- Upload to S3.
- Store backup locally on server
- Download backup file from server.
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
Built Distribution
File details
Details for the file django_backups-0.0.2.tar.gz
.
File metadata
- Download URL: django_backups-0.0.2.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a066130c7fedc11d0b711f5994b65c8cd9433ec9f3deab3eb8f1a6076b092774 |
|
MD5 | 6bb2f2e56e8b4d2415ebb1c21b8a3f9a |
|
BLAKE2b-256 | c5ce8a67f524fb19086dd75cc43a00e9337e9416c6b575d6b90b280a94dfe83b |
File details
Details for the file django_backups-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: django_backups-0.0.2-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aeac33036efbc5dba3fb26bc1f6535a890a73318fe6bc64f1fcc5f51350ade32 |
|
MD5 | a49f3ad76356b8cc4bf24374be6b5d64 |
|
BLAKE2b-256 | 1f3941b92bcb17ecd703a2c07653c93d192370393a2c17248fb4c2d970a6cfd9 |