[Fixed]-Django south fresh install –> error: unknown command 'schemamigration'

8👍

You are probably using some old South version, 0.6.x or even 0.5.x. If you type that “./manage.py help” you should see startmigration (iirc) on the list of available commands.

35👍

You probably haven’t added ‘south’ into the list of INSTALLED_APPS of your settings.py file.

Here’s a quote from http://south.aeracode.org/docs/installation.html#installation-configure

Now you’ve installed South system-wide, you’ll need to configure
Django to use it. Doing so is simple; just edit your settings.py and
add ‘south’ to the end of INSTALLED_APPS.

If Django doesn’t seem to pick this up, check that you’re not
overriding INSTALLED_APPS elsewhere, and that you can run import south
from inside ./manage.py shell with no errors.

Once South is added in, you’ll need to run ./manage.py syncdb to make
the South migration-tracking tables (South doesn’t use migrations for
its own models, for various reasons).

4👍

Instead of using the Ubuntu package, use easy_install or pip to install South. This will ensure you have the most recent version.

3👍

I think this problem can be very elusive. I spent considerable time and I then figured out that I was overriding INSTALLED_APPS for some testing. Doh! So this is key. Be sure to add south at the end of your INSTALLED_APPS and if you override it, check that too.

2👍

check, which settings.py file you use:

./manage.py shell
import settings
settings.__file__

you may see in manage.py, which settings file Django use by defaul:

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "app.settings")

or you may use:

 $./manage.py schemamigration junk_app --settings=settings --initial

instead of:

 $./manage.py schemamigration junk_app --initial

2👍

If you have your settings in a settings folder, make sure you use a . and not / in the path.
Example: ./manage.py schemamigration secretballot --initial --settings=settings.jacob

👤webjay

Leave a comment