dirtshell
dirtshell

Reputation: 171

syncdb and updating database schema in Django

I have been working on developing the models for a Django app. I am working on it in my spare time. I have an issue when it comes to testing. Whenever I realize I have a mistake in my models, I have to go through the trivial but annoying process of dropping the corresponding database and then recreating it and running python manage.py syncdb. Apparently, this is because Django's syncdb cannot change the database schema. I do not fully understand what that means. Although, I know it is a pain to have to keep deleting and recreating my database every time I try and change something in my models.

Is there a better way of doing this? Is something wrong with my install? I feel like this is such a simple thing to fix that I must be doing something wrong.

Upvotes: 2

Views: 2723

Answers (1)

karthikr
karthikr

Reputation: 99620

No, nothing is wrong with your installation. It is a limitation of django.

There is a 3rd party app called django-south, which can be used for managing "migrations" (changes to database models). It is a very widely used app for managing database changes.

There are lots of documentation online to help you understand how south works, and how to use it.

This is a good tutorial on south

Upvotes: 2

Related Questions