# 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.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)
Raw data
{
"_id": null,
"home_page": "https://github.com/Taofeeq97/postgreSQL_backup.git",
"name": "django-db-s3-backup",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "django database backup s3_access",
"author": "Otu Taofeeq",
"author_email": "otutaofeeqi@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/46/52/da41fc145cc2459eb173b1e8da8cf606bd0c3488b2abcbe6d194941f2bf2/django_db_s3_backup-0.1.2.tar.gz",
"platform": null,
"description": "# Django DB S3 Backup\r\n\r\nA robust Django library for automated PostgreSQL database backups with local and S3 storage support, featuring scheduled backups and restoration capabilities.\r\n\r\n## Features\r\n\r\n- \ud83d\uddc4\ufe0f Automated database backups\r\n- \u23f0 Scheduled backups using cron syntax\r\n- \ud83d\udcbe Local backup storage with rotation\r\n- \u2601\ufe0f S3 backup storage with rotation\r\n- \ud83d\udd04 Easy restoration process\r\n- \ud83d\udd12 Secure credential management\r\n\r\n## Installation\r\n\r\n```bash\r\npip install django-db-s3-backup\r\n\r\n\r\n\r\n## Configuration\r\n#Add to your INSTALLED_APPS\r\nINSTALLED_APPS = [\r\n ...\r\n 'django_db_s3_backup.apps.DBS3BackupConfig',\r\n 'django_apscheduler', \r\n ...\r\n]\r\n\r\n\r\n#Database Configuration\r\n# Optional - falls back to default Django DB settings if not specified\r\nDB_BACKUP_HOST = 'backup.db.example.com'\r\nDB_BACKUP_PORT = '5432'\r\nDB_BACKUP_NAME = 'backup_db'\r\nDB_BACKUP_USER = 'backup_user'\r\nDB_BACKUP_PASSWORD = 'securepassword'\r\n\r\n\r\n#Local Storage\r\nDB_BACKUP_LOCAL_DIR = os.path.join(BASE_DIR, 'db_backups') # Local backup directory\r\nDB_BACKUP_MAX_LOCAL = 5 # Max local backups to keep\r\n\r\n\r\n#S3 Storage\r\n\r\nDB_BACKUP_S3_ENABLED = True # Set False to disable S3\r\nDB_BACKUP_S3_BUCKET_NAME = 'your-backup-bucket'\r\nDB_BACKUP_S3_ACCESS_KEY = 'your-access-key' # Consider using env vars\r\nDB_BACKUP_S3_SECRET_KEY = 'your-secret-key' # Consider using env vars\r\nDB_BACKUP_S3_DIR = 'backups' # S3 path prefix\r\nDB_BACKUP_MAX_S3 = 30 # Max S3 backups to keep\r\n\r\n\r\n\r\n#Scheduling\r\nDB_BACKUP_SCHEDULE_ENABLED = True # Enable scheduled backups, False by default\r\nDB_BACKUP_SCHEDULE_CRON = '0 2 * * *' # 2 AM daily (cron syntax)\r\n",
"bugtrack_url": null,
"license": null,
"summary": "Django database backup with S3 storage and scheduling",
"version": "0.1.2",
"project_urls": {
"Homepage": "https://github.com/Taofeeq97/postgreSQL_backup.git"
},
"split_keywords": [
"django",
"database",
"backup",
"s3_access"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "518e3444fa4192845f016b2c97c5a7f6d7841d9324889ac70d354f27f03c6bdc",
"md5": "7d038cb8773dc1b0a6fea71fed982dc4",
"sha256": "22eb95c5e8fae2548f649cc6c5c43bc021c8e267b00264acb64606e47ccc44ab"
},
"downloads": -1,
"filename": "django_db_s3_backup-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7d038cb8773dc1b0a6fea71fed982dc4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 13211,
"upload_time": "2025-08-07T15:45:59",
"upload_time_iso_8601": "2025-08-07T15:45:59.266081Z",
"url": "https://files.pythonhosted.org/packages/51/8e/3444fa4192845f016b2c97c5a7f6d7841d9324889ac70d354f27f03c6bdc/django_db_s3_backup-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "4652da41fc145cc2459eb173b1e8da8cf606bd0c3488b2abcbe6d194941f2bf2",
"md5": "90583e660f66ce6be9d34a287852d3bb",
"sha256": "4490c2431130d5731f41c6f3298d8a083a04a27acdb8ec095dac0ee15a22b2ff"
},
"downloads": -1,
"filename": "django_db_s3_backup-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "90583e660f66ce6be9d34a287852d3bb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 10806,
"upload_time": "2025-08-07T15:46:01",
"upload_time_iso_8601": "2025-08-07T15:46:01.258165Z",
"url": "https://files.pythonhosted.org/packages/46/52/da41fc145cc2459eb173b1e8da8cf606bd0c3488b2abcbe6d194941f2bf2/django_db_s3_backup-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-07 15:46:01",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Taofeeq97",
"github_project": "postgreSQL_backup",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "django-db-s3-backup"
}