Switching from South migrations to Django migrations

If you, like me, have been using Django since before database migrations existed in the core functionality, that is, before Django 1.7; you have, more than likely, used third-party South migrations before. In this recipe, you will learn how to switch your project from South migrations to Django migrations.

Getting ready

Make sure that all apps and their South migrations are up to date.

How to do it…

Execute the following steps:

  1. Migrate all your apps to the latest South migrations, as follows:
    (myproject_env)$ python manage.py migrate
    
  2. Remove south from INSTALLED_APPS in the settings.
  3. For each app with South migrations, delete the migration files and only leave the migrations directories.
  4. Create new ...

Get Web Development with Django Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.