Manoj M J
Manoj M J

Reputation: 449

copy mysql database fully in django

My team is building a website in django. We are using MySql and the database we created for the project is called 'vote'

We always share the code, but the problem is that whatever my project team has added to the database has to be added by me again,manually so as to use it.

Is there any way in which we can copy the whole database created by my team to my system?

Thanks

Upvotes: 0

Views: 360

Answers (1)

Timmy O'Mahony
Timmy O'Mahony

Reputation: 53981

There are 3 approachs off the top of my head:

  1. Export and Import the entire mysql database (using mysqldump or similar).
  2. Use Django's fixtures system. This allows you to dump the contents of the DB to json/xml files which can be loaded again later by other members of the team via python manage.py loaddata .... These can be quite temperamental in reality and I generally find them more hassle then they are worth to implement.
  3. Use South's data migrations. South is primarily concerned with managing schema migrations, i.e. gracefully handling the addition and deletion of fields on your models so that you don't end up with an inconstant DB. You can also use it to write data migrations which will allow you to programatically add data to the DB which you can share amongst your team mates.

Upvotes: 2

Related Questions