Search code examples
djangodjango-south

Can't add South to Django 1.6.2 Project


I've got an existing Django project that I'm trying to add South to. I'm fine with losing ally my data (in fact, I've already dropped/created the database several times).

The problem is that I do the following:

(in psql)

  1. drop database myproject

  2. create database myproject

(at the command line)

  1. python manage.py syncdb --migrate

  2. python manage.py schemamigration myproject.myapp --initial

  3. python manage.py migrate myproject.myapp

Everything works great until I get to that last command; when I run it I get:

django.db.utils.ProgrammingError: relation "myapp_somemodel" already exists

(where "somemodel" is a model in myapp).

I've tried searching SO, but all the posts I found suggested the set of commands above. Can anyone please help me get South added to this project?


Solution

  • You need to run migrate with --fake option for your initial migration:

    $ python manage.py migrate myproject.myapp 0001 --fake
    

    Also see Converting An App chapter from South docs.