Skip to main content

Django DB S3 Backup

A robust Django library for automated PostgreSQL database backups with local and S3 storage support, featuring scheduled backups and restoration capabilities.

Features

  • 🗄️ Automated database backups
  • ⏰ Scheduled backups using cron syntax
  • 💾 Local backup storage with rotation
  • ☁️ S3 backup storage with rotation
  • 🔄 Easy restoration process
  • 🔒 Secure credential management

Installation

pip install django-db-s3-backup



## Configuration
#Add to your INSTALLED_APPS
INSTALLED_APPS = [
    ...
    'django_db_s3_backup.apps.DBS3BackupConfig',
    'django_apscheduler', 
    ...
]


#Database Configuration
# Optional - falls back to default Django DB settings if not specified
DB_BACKUP_HOST = 'backup.db.example.com'
DB_BACKUP_PORT = '5432'
DB_BACKUP_NAME = 'backup_db'
DB_BACKUP_USER = 'backup_user'
DB_BACKUP_PASSWORD = 'securepassword'


#Local Storage
DB_BACKUP_LOCAL_DIR = os.path.join(BASE_DIR, 'db_backups')  # Local backup directory
DB_BACKUP_MAX_LOCAL = 5  # Max local backups to keep


#S3 Storage

DB_BACKUP_S3_ENABLED = True  # Set False to disable S3
DB_BACKUP_S3_BUCKET_NAME = 'your-backup-bucket'
DB_BACKUP_S3_ACCESS_KEY = 'your-access-key'  # Consider using env vars
DB_BACKUP_S3_SECRET_KEY = 'your-secret-key'  # Consider using env vars
DB_BACKUP_S3_DIR = 'backups'  # S3 path prefix
DB_BACKUP_MAX_S3 = 30  # Max S3 backups to keep



#Scheduling
DB_BACKUP_SCHEDULE_ENABLED = True  # Enable scheduled backups, False by default
DB_BACKUP_SCHEDULE_CRON = '0 2 * * *'  # 2 AM daily (cron syntax)

Metadata

Release files for django-db-s3-backup 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-db-s3-backup 0.1.3
File Size Uploaded Provenance Actions
django_db_s3_backup-0.1.3.tar.gz 10.8 kB Without provenance Details for django_db_s3_backup-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-db-s3-backup 0.1.3
File Interpreter ABI Platform Actions
django_db_s3_backup-0.1.3-py3-none-any.whl Python 3 none any Details for django_db_s3_backup-0.1.3-py3-none-any.whl

Total release size: 24.0 kB

Release files / django_db_s3_backup-0.1.3.tar.gz

Download URL django_db_s3_backup-0.1.3.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5eaa010f9dea5b726c966e82a354796ab20634084c63b98d0bc37b19988c2006
BLAKE2b-256 checksum
How to use checksums
07e3aea805f27dbe544dec23fda0c3a65fab479ab39a45c2d7ee169cd53a7101
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Release files / django_db_s3_backup-0.1.3-py3-none-any.whl

Download URL django_db_s3_backup-0.1.3-py3-none-any.whl
Size 13.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0a28b70c10e486d3272ea9c572d8f8ec34399b22d24d4185491d2a6137d3ca8c
BLAKE2b-256 checksum
How to use checksums
b57b06581bc101f47ee65e18966bf0eddc110c96dee9f00b95e1c11ce5a57a9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Security for django-db-s3-backup 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page