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
# ...
INSTALLED_APPS = (
# ...
'django_db_seed',
)
# ...
DJANGO_DB_SEED = {
'seed_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
File details
Details for the file django-db-seed-1.0.1.tar.gz
.
File metadata
- Download URL: django-db-seed-1.0.1.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7b9250b11b49e85d1498bdd4fde1dd1f2d5acee15a0aea29e21e76253a98116 |
|
MD5 | b0fb1464e3a000a34e78e662e4142df1 |
|
BLAKE2b-256 | aa8752c9a222de83629318e95462f080b582b6a04ecca9fbf47cb94fc117d7e1 |
File details
Details for the file django_db_seed-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: django_db_seed-1.0.1-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1786eb847a6e9067f401318c0635326618da5036e2e32f5d251414e2e41ebdb |
|
MD5 | 1f84389a5947d1d1247dfc9d24364ffc |
|
BLAKE2b-256 | 2643c8c68b91c65dbd7e4c4ea95dc2727008c17175cc563a9a7d726a00366ba2 |