A django app I am working on helps write reports. The report templates as well as report text template fragments are kept in a database. What is the best practice in Django to have only these two models – report templates and fragment templates exported and then loaded in dev environments.
One option is to use dumpdata and loaddata, but that appears to do it for everything and that’s undesirable.
Any ideas/hints/tips appreciated.
You can just dump the data for a specific model using the
dumpdataoptional argumentshttps://docs.djangoproject.com/en/dev/ref/django-admin/#dumpdata-appname-appname-appname-model
python manage.py dumpdata yourapp.YourModelwill output only the data for the specific model.I like to mirror production environment when developing. This can be accomplished extremely easily by just exporting your database to a .sql file.