4 ms·
One common mistake is thinking that you need a fully-fleshed-out dataset with real data. You don't. You just need the bare-bones structure with some generic dat
by sanderson1 10y ago
One common mistake is thinking that you need a fully-fleshed-out dataset with real data. You don't. You just need the bare-bones structure with some generic data, which can easily be accomplished with a seed file. Django calls these fixtures: https://docs.djangoproject.com/en/1.10/howto/initial-data/ https://docs.djangoproject.com/en/1.10/howto/initial-data/.
Once the initial data is seeded, you then just need to implement migrations to update the database as the structure is modified. These too are already built into Django: https://docs.djangoproject.com/en/1.10/topics/migrations/ https://docs.djangoproject.com/en/1.10/topics/migrations/.
With those in place, every developer can have their own local environment with its own database. I personally use Nanobox (https://nanobox.io https://nanobox.io) to spin up dev environments with local databases. I then can console into the environment, run the seeding process and any migrations I need too. You just need to set up a version control workflow to keep everybody's codebase in sync.
- raviojha 10y agoYeah, idea to have fixtures is good. We recently migrated from django 1.4 to 1.10 and this time we are tracking all migrations in repo, so atleast the part of maintaining the schema is not a pain anymore. Thanks for mentioning nanobox, will explore.