[Answer]-Django 1.6 editing userprofile model with existing users

1👍

Here is how to do it..

First install south

pip install south

Then add to your settings INSTALLED_APP list as –

   ...,
   'south',
   ...

What is south?.. Well south is a django app that helps you updating your database without having to rebuild it. Now initialise your models with-

python manage.py syncdb // this will create the south tables for migrations
python manage.py schemamigration <appname> --initial //  (once per app) this will create the initial model files in a migrations package
python manage.py migrate

Then every time you update your models just need to perform an update with –

python manage.py schemamigration <appname> --auto
python manage.py migrate <appname>

You can find the full documentation here – http://south.readthedocs.org/en/latest/tutorial/

Leave a comment