Metadata-Version: 2.4
Name: django-db-s3-backup
Version: 0.1.1
Summary: Django database backup with S3 storage and scheduling
Home-page: https://github.com/Taofeeq97/postgreSQL_backup.git
Author: Otu Taofeeq
Author-email: otutaofeeq@gmail.com
Keywords: django database backup s3_access
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Framework :: Django
Classifier: Framework :: Django :: 3.2
Classifier: Framework :: Django :: 4.0
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Django>=3.2
Requires-Dist: boto3>=1.26.0
Requires-Dist: django-apscheduler>=0.6.2
Provides-Extra: dev
Requires-Dist: pytest>=6.0; extra == "dev"
Requires-Dist: pytest-django>=4.5.0; extra == "dev"
Requires-Dist: coverage>=6.0; extra == "dev"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license-file
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# 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

```bash
pip install django-db-s3-backup



## Configuration
#Add to your INSTALLED_APPS
INSTALLED_APPS = [
    ...
    'django_db_s3_backup',
    '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)
