# dj_backup
## What is this ?
DJ Backup is a Django app that provides the capability to back up your files and databases.
### Available at:
- #### <a href="https://pypi.org/project/djbackup/">pypi</a>
- #### <a href="https://github.com/FZl47/dj_backup">github</a>
##### supported databases
- mysql
- postgres
- sqlite
##### supported storages
- local
- sftp server
- ftp server
- dropbox
- telegram bot
## How to use ?
#### 1. First you need to install dj_backup
```sh
pip install djbackup
```
OR
- #### for using all features
```sh
pip install djbackup[all]
```
#### 2. After that, add the `dj_backup` app to your Django project's installed apps.
```pycon
INSTALLED_APPS = [
...
...
# apps
'dj_backup',
]
```
#### 3. add static files dir path to django
```python
from dj_backup.core.utils.static import load_static
STATICFILES_DIRS = [
...
load_static()
]
```
#### 4. add dj_backup urls to project urls
```python
urlpatterns = [
...
path('dj-backup/', include('dj_backup.urls', namespace='dj_backup')),
...
]
```
#### 5. set dj_backup <span style="text-decoration: underline;">basic config</span> to django settings
```python
DJ_BACKUP_CONFIG = {
'STORAGES': {
'LOCAL': {
'OUT': BASE_DIR / 'backup/result'
},
}
}
```
#### 6. migrate & collect static files
```python
python manage.py migrate
```
```python
python manage.py collectstatic
```
#### 7. run backup!
- command is for managing settings and executing backup tasks
```python
python manage.py run-backup
```
#### 8. run django
```python
python manage.py runserver
```
- OR use wsgi/asgi handler like: (uwsgi, gunicorn, waitress or etc)
### Dashboard
#### now you can access to `dj_backup` dashboard
```djangourlpath
127.0.0.1:8000/dj-backup/
```
OR
```djangourlpath
xxx.xxx:xxxx/dj-backup/
```
### Full Config
```python
# DJ_BACKUP_CONFIG = {
# 'MAX_WORKERS': 5, #(optional)
# 'NOTIFICATION_OBJECT_LOG_LEVEL': 'WARNING', #(optional) # options => ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']
# 'POSTGRESQL_DUMP_PATH': None, # optional(If the postgresql dump file is not found, you can set it)
# 'MYSQL_DUMP_PATH': None, # optional(If the mysql dump file is not found, you can set it)
# 'EXTERNAL_DATABASES': {
# 'default2': {
# 'ENGINE': 'postgresql',
# 'NAME': 'test',
# 'USER': 'postgres',
# 'PASSWORD': 'xxx',
# 'HOST': '127.0.0.1', # Or an IP Address that your DB is hosted on
# },
# 'default3': {
# 'ENGINE': 'mysql',
# 'NAME': 'test',
# 'USER': 'root',
# 'PASSWORD': 'xxx',
# 'HOST': '127.0.0.1', # Or an IP Address that your DB is hosted on
# },
# },
# 'BASE_ROOT_DIRS': [
# BASE_DIR,
# ],
# 'BACKUP_TEMP_DIR': BASE_DIR / 'backup/temp', #(optional)
# 'BACKUP_SYS_DIR': BASE_DIR / 'backup/sys', #(optional)
# 'STORAGES': {
# 'LOCAL': {
# 'OUT': BASE_DIR / 'backup/result'
# },
# 'TELEGRAM_BOT': {
# 'BOT_TOKEN': 'xxx-xxx',
# 'CHAT_ID': 'xxx-xxx'
# }
# 'SFTP_SERVER': {
# 'HOST': 'xxx',
# 'USERNAME': 'xxx',
# 'PASSWORD': 'xxx',
# 'OUT': 'xxx'
# },
# 'FTP_SERVER': {
# 'HOST': "xxx",
# 'USERNAME': "xxx",
# 'PASSWORD': "xxx",
# 'OUT': 'backups'
# },
# 'DROPBOX': {
# 'APP_KEY': 'xxx-xxx',
# 'OUT': '/dj_backup/'
# }
# }
# }
```
- ### <span style="text-decoration: underline;line-height:50px;">To use storage providers or perform database backups, you need to install the appropriate packages according to your needs using the commands below</span>
### - storages:
| storage | install command |
|--------------|----------------------------------------|
| TELEGRAM_BOT | ```pip install djbackup[telegram]``` |
| SFTP_SERVER | ```pip install djbackup[sftpserver]``` |
| FTP_SERVER | ```pip install djbackup[ftpserver]``` |
| DROPBOX | ```pip install djbackup[dropbox]``` |
### - databases:
| database | install command |
|------------|----------------------------------------|
| mysql | ```pip install djbackup[mysql]``` |
| postgresql | ```pip install djbackup[postgresql]``` |
## NOTE:
If you dont need any of the storages, you must remove that configuration
because you get an error if it cant be connected
Raw data
{
"_id": null,
"home_page": "https://github.com/FZl47/dj_backup",
"name": "djbackup",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "django, database, media, backup, dropbox, ftp, sftp, mysql, postgresql, sqlite",
"author": "FZl47",
"author_email": "fzl8747@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/14/a8/f6fe14834b46d7684f6577b8e8e135e01558cc326c73af42c87afa7cae78/djbackup-2.3.1.tar.gz",
"platform": null,
"description": "# dj_backup\r\n\r\n## What is this ?\r\n\r\n DJ Backup is a Django app that provides the capability to back up your files and databases.\r\n\r\n### Available at:\r\n\r\n- #### <a href=\"https://pypi.org/project/djbackup/\">pypi</a>\r\n- #### <a href=\"https://github.com/FZl47/dj_backup\">github</a>\r\n\r\n##### supported databases\r\n\r\n- mysql\r\n- postgres\r\n- sqlite\r\n\r\n##### supported storages\r\n\r\n- local\r\n- sftp server\r\n- ftp server\r\n- dropbox\r\n- telegram bot\r\n\r\n## How to use ?\r\n\r\n#### 1. First you need to install dj_backup\r\n\r\n```sh\r\n pip install djbackup\r\n```\r\n\r\nOR\r\n\r\n- #### for using all features\r\n\r\n```sh\r\n pip install djbackup[all]\r\n```\r\n\r\n#### 2. After that, add the `dj_backup` app to your Django project's installed apps.\r\n\r\n```pycon\r\n INSTALLED_APPS = [\r\n ...\r\n ...\r\n # apps\r\n 'dj_backup',\r\n]\r\n```\r\n\r\n#### 3. add static files dir path to django\r\n\r\n```python\r\nfrom dj_backup.core.utils.static import load_static\r\n\r\nSTATICFILES_DIRS = [\r\n ...\r\n load_static()\r\n]\r\n\r\n```\r\n\r\n#### 4. add dj_backup urls to project urls\r\n\r\n```python\r\nurlpatterns = [\r\n ...\r\n path('dj-backup/', include('dj_backup.urls', namespace='dj_backup')),\r\n ...\r\n]\r\n```\r\n\r\n#### 5. set dj_backup <span style=\"text-decoration: underline;\">basic config</span> to django settings\r\n\r\n```python\r\n\r\nDJ_BACKUP_CONFIG = {\r\n 'STORAGES': {\r\n 'LOCAL': {\r\n 'OUT': BASE_DIR / 'backup/result'\r\n },\r\n }\r\n}\r\n\r\n```\r\n\r\n#### 6. migrate & collect static files\r\n\r\n```python\r\n python manage.py migrate\r\n```\r\n\r\n```python\r\n python manage.py collectstatic\r\n```\r\n\r\n#### 7. run backup!\r\n\r\n- command is for managing settings and executing backup tasks\r\n\r\n```python\r\n python manage.py run-backup\r\n```\r\n\r\n#### 8. run django\r\n\r\n\r\n```python\r\n python manage.py runserver\r\n```\r\n\r\n- OR use wsgi/asgi handler like: (uwsgi, gunicorn, waitress or etc)\r\n\r\n### Dashboard\r\n\r\n#### now you can access to `dj_backup` dashboard\r\n\r\n```djangourlpath\r\n 127.0.0.1:8000/dj-backup/\r\n```\r\n\r\nOR\r\n\r\n```djangourlpath\r\n xxx.xxx:xxxx/dj-backup/ \r\n```\r\n\r\n### Full Config\r\n\r\n```python\r\n# DJ_BACKUP_CONFIG = {\r\n # 'MAX_WORKERS': 5, #(optional)\r\n # 'NOTIFICATION_OBJECT_LOG_LEVEL': 'WARNING', #(optional) # options => ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']\r\n # 'POSTGRESQL_DUMP_PATH': None, # optional(If the postgresql dump file is not found, you can set it)\r\n # 'MYSQL_DUMP_PATH': None, # optional(If the mysql dump file is not found, you can set it)\r\n # 'EXTERNAL_DATABASES': {\r\n # 'default2': {\r\n # 'ENGINE': 'postgresql',\r\n # 'NAME': 'test',\r\n # 'USER': 'postgres',\r\n # 'PASSWORD': 'xxx',\r\n # 'HOST': '127.0.0.1', # Or an IP Address that your DB is hosted on\r\n # },\r\n # 'default3': {\r\n # 'ENGINE': 'mysql',\r\n # 'NAME': 'test',\r\n # 'USER': 'root',\r\n # 'PASSWORD': 'xxx',\r\n # 'HOST': '127.0.0.1', # Or an IP Address that your DB is hosted on\r\n # },\r\n # },\r\n # 'BASE_ROOT_DIRS': [\r\n # BASE_DIR,\r\n # ],\r\n # 'BACKUP_TEMP_DIR': BASE_DIR / 'backup/temp', #(optional)\r\n # 'BACKUP_SYS_DIR': BASE_DIR / 'backup/sys', #(optional)\r\n # 'STORAGES': {\r\n # 'LOCAL': {\r\n # 'OUT': BASE_DIR / 'backup/result'\r\n # },\r\n # 'TELEGRAM_BOT': {\r\n # 'BOT_TOKEN': 'xxx-xxx',\r\n # 'CHAT_ID': 'xxx-xxx'\r\n # }\r\n # 'SFTP_SERVER': {\r\n # 'HOST': 'xxx',\r\n # 'USERNAME': 'xxx',\r\n # 'PASSWORD': 'xxx',\r\n # 'OUT': 'xxx'\r\n # },\r\n # 'FTP_SERVER': {\r\n # 'HOST': \"xxx\",\r\n # 'USERNAME': \"xxx\",\r\n # 'PASSWORD': \"xxx\",\r\n # 'OUT': 'backups'\r\n # },\r\n # 'DROPBOX': {\r\n # 'APP_KEY': 'xxx-xxx',\r\n # 'OUT': '/dj_backup/'\r\n # }\r\n # }\r\n# }\r\n```\r\n\r\n- ### <span style=\"text-decoration: underline;line-height:50px;\">To use storage providers or perform database backups, you need to install the appropriate packages according to your needs using the commands below</span>\r\n\r\n### - storages:\r\n\r\n| storage | install command |\r\n|--------------|----------------------------------------| \r\n| TELEGRAM_BOT | ```pip install djbackup[telegram]``` |\r\n| SFTP_SERVER | ```pip install djbackup[sftpserver]``` |\r\n| FTP_SERVER | ```pip install djbackup[ftpserver]``` |\r\n| DROPBOX | ```pip install djbackup[dropbox]``` |\r\n\r\n### - databases:\r\n\r\n| database | install command |\r\n|------------|----------------------------------------| \r\n| mysql | ```pip install djbackup[mysql]``` |\r\n| postgresql | ```pip install djbackup[postgresql]``` |\r\n\r\n## NOTE:\r\n\r\n If you dont need any of the storages, you must remove that configuration\r\n because you get an error if it cant be connected\r\n\r\n",
"bugtrack_url": null,
"license": null,
"summary": "djbackup(django backup) is an installable module for Django that is used for backup purposes, specifically for backing up the database and media files.",
"version": "2.3.1",
"project_urls": {
"Homepage": "https://github.com/FZl47/dj_backup"
},
"split_keywords": [
"django",
" database",
" media",
" backup",
" dropbox",
" ftp",
" sftp",
" mysql",
" postgresql",
" sqlite"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "c335e793777108c97f1a68bdc1a3d13b5845458addd4aced0f42a0568285f6c7",
"md5": "2e25dc5f2903ceb57f2e4013190c15de",
"sha256": "8fca7964c3f61ab318b7992788e9658f9608c87dfc9b62f3cbd583cef0d6953c"
},
"downloads": -1,
"filename": "djbackup-2.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2e25dc5f2903ceb57f2e4013190c15de",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 1752481,
"upload_time": "2025-07-14T21:43:01",
"upload_time_iso_8601": "2025-07-14T21:43:01.767406Z",
"url": "https://files.pythonhosted.org/packages/c3/35/e793777108c97f1a68bdc1a3d13b5845458addd4aced0f42a0568285f6c7/djbackup-2.3.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "14a8f6fe14834b46d7684f6577b8e8e135e01558cc326c73af42c87afa7cae78",
"md5": "f994b786e8e26712285694f0d297a25a",
"sha256": "58101ae156c5e003a7696ed35c065a254d823e57890509877a4a3399145f4608"
},
"downloads": -1,
"filename": "djbackup-2.3.1.tar.gz",
"has_sig": false,
"md5_digest": "f994b786e8e26712285694f0d297a25a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 1720130,
"upload_time": "2025-07-14T21:43:11",
"upload_time_iso_8601": "2025-07-14T21:43:11.568131Z",
"url": "https://files.pythonhosted.org/packages/14/a8/f6fe14834b46d7684f6577b8e8e135e01558cc326c73af42c87afa7cae78/djbackup-2.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-14 21:43:11",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "FZl47",
"github_project": "dj_backup",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "djbackup"
}