A Django app to backup and restore the database.
Project description
Django DB Seed
Django DB Seed is a Django package designed to simplify the process of seeding your database with initial data. It provides a convenient way to define and load seed data into your Django project.
Installation
You can install Django DB Seed using pip:
pip install django-db-seed
Configuration
To configure Django DB Seed, you can define the following settings in your Django project's settings file (settings.py
):
# settings.py
# ...
from django.conf import settings
# ...
INSTALLED_APPS = (
# ...
'django_db_seed',
)
# ...
DJANGO_DB_SEED = {
'seed_dir': f"{settings.BASE_DIR}/db-seed/",
'apps': [
"admin",
"auth",
]
}
seed_dir
: Specifies the directory where your seed data files are located. By default, it is set to a directory nameddb-seed
in your project's base directory (BASE_DIR
).apps
: Specifies the Django apps for which you want to load seed data. You can specify one or more app names in a list.
Usage
Once configured, you can use Django DB Seed to manage your database seed data.
Backup Database Seed Data
To backup the seed data in your files, run the following management command:
python manage.py db-seed --mode=backup
Restore Database Seed Data
To restore the seed data in your database from backup, run the following management command:
python manage.py db-seed --mode=restore
License
This project is licensed under the MIT License - see the LICENSE file for details.
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
Hashes for django_db_seed-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b7672135e07cd2ff6e57aa89d5ece921af9fadc4953f8acd02202b694a538a3 |
|
MD5 | 0db8d8c57fde3e3764e6f2b8432b1c2c |
|
BLAKE2b-256 | 1ad96a557a1b4ded5cb60d1eb64430be277ee6252b04976dba2e2180c64ff2c0 |