Django model export on MySql server
Question: I imported the external database into my project , thereby converting it to
`models.py` file using `python manage.py inspectdb > models.py` command.

Now I have edited the models.py file by adding another class. How can I export
the `models.py` file onto the MySql server without hampering the data already
in the database?


Answer: Basically, what you need is a
[`syncdb`](https://docs.djangoproject.com/en/dev/ref/django-admin/#syncdb)

> Creates the database tables for all apps in INSTALLED_APPS whose tables have
> not already been created.

But, syncdb will only create tables for models which have not yet been
installed. It will never issue `ALTER TABLE` statements to match changes made
to a model class after installation.

There are 3rd party apps in django like [django-
south](http://south.aeracode.org/) which manage the migrations for you, so you
dont have to do all this manually.

Here is a link that explains [how to work with
south](http://www.djangopro.com/2011/01/django-database-migration-tool-south-
explained/)

