[Fixed]-Newbie difficulty using south with pycharm – DatabaseError: no such table: south_migrationhistory

31👍

South uses a table if its own to keep track of which migrations have been applied. Before you can apply any migrations, this must have been created, using python ./manage.py syncdb.

As well as for setting up south, you will find syncdb sometimes necessary for non-south apps in your project, such as the very common django.contrib.auth.

Note that as a convenience, you can run both in one go like this

python ./manage.py syncdb --migrate
👤kdt

2👍

My latest (unsuccessful) effort was the following

  1. Create application – synch db – superuser created
  2. Test run –admin screen shows basic tables
  3. Add south, and syncdb from command line with manage.py syncdb – south_migrationhistory table created. Add basic vanilla model
  4. Tried various combinations of manage.py syncdb –manage, and
    schemamigration from Pycharm (if run from within pycharm a
    migrations directory is created within the app
    – if run from the command line the directory does not seem to be
    created.)
  5. Django admin screen shows table – but if I try to edit
    the table it says that it doesn’t exist
  6. Check database structure
    using SQLite browser – table for newly created model doesn’t exist

I’m starting to think that the whole thing is not worth the time wasting hassle – maybe I’m better off just modifying the tables in SQLite browser

👤Marg

0👍

Answer in the similar question:

Run syncdb to add the Django and South tables to the database.

👤jpic

Leave a comment