Tool to automatically create a development database for local development by sampling your production database. It maintains referential integrity by looking up the dependencies for the selected rows.
pip install dev_db
Add dev_db to your installed apps
Customize the CreateDevDB class
DEV_DB_CREATOR = 'dev_db.creator.DevDBCreator'
# for fashiolista
DEV_DB_CREATOR = 'framework.dev_db_creator.FashiolistaDBCreator'
python manage.py create_dev_db -o development_data.json
gzip development_data.json
Creating the test fixture takes about 5-10 minutes
start with an empty db on local called test_fashiolista_local
- python manage.py syncdb --all --noinput
- python manage.py migrate --fake --noinput
- Truncate contenttype and permission tables
- python manage.py loaddata development_data.json.gz --traceback -v2
These four steps are also wrapped in the load_dev_db command. So simply run (This assumes you don't have the database yet, it wont drop it for you)
python manage.py load_dev_db
Loading the fixture takes about 2 minutes
(be sure to run pgtune on your local postgres, otherwise it might take longer)
From the dev_db_example directory run
python manage.py test dev_db