Django 1.8 upgrade

38 views
Skip to first unread message

Grischa

unread,
Jun 7, 2015, 8:58:22 PM6/7/15
to tardis...@googlegroups.com
Hi All!

As you may or may not have noticed Django 1.6 is unsupported and thus insecure to keep using. Django 1.8 is going to be supported for 3 years, similar to the Ubuntu LTS releases, so it will be nice to upgrade to it and then not worry about feature deprecation etc. for 3 years.

To get to that state, there are a few small changes required to MyTardis and also any additional apps you may have developed.

Here is a list of the most important ones:

1. Migrations: Django 1.8 has a built-in way to migrate databases. I moved the old migrations to a directory called 'south_migrations' for the time being, however, they are not being used at all in a standard installation.
To upgrade an existing database to Django 1.8 you need to first upgrade to one version before Django 1.8, run all the south migrations, then run python mytardis.py migrate --fake-initial.
If you start with a new database you can just use the new migrations only.
If you have other apps running in MyTardis you will have to upgrade them to the new migration system as well.

2. Some libraries like tastypie and django-registration needed to be updated. While my tests showed no issues, there may be subtle changes in behaviour. Please test your use cases before upgrading any production systems.

3. I turned on timezone support by default. Seems to be no issue, but good to double-check if you rely on the date fields a lot.

4. Context is now just a dictionary. This may require changes in your apps, too.

Here is the list of changes:

I will merge this after a bit more testing, and I will make sure there's a tag available for the final south migration. I'll post here with details.

Any further testing by you and any feedback is most welcome.

Grischa

James Wettenhall

unread,
Jul 12, 2015, 11:24:59 PM7/12/15
to tardis...@googlegroups.com
Hi,


On 8 June 2015 at 10:58, Grischa <gri...@gmail.com> wrote:
1. Migrations: Django 1.8 has a built-in way to migrate databases. I moved the old migrations to a directory called 'south_migrations' for the time being, however, they are not being used at all in a standard installation.
To upgrade an existing database to Django 1.8 you need to first upgrade to one version before Django 1.8, run all the south migrations, then run python mytardis.py migrate --fake-initial.

This failed for me initially with:

There is no South database module 'south.db.postgresql_psycopg2' for your database. Please either choose a supported database, check for SOUTH_DATABASE_ADAPTER[S] settings, or remove South from INSTALLED_APPS.

I checked that all references to 'south' had been removed from settings.py, but I still got the above error.

Doing the following fixed the problem: 

pip uninstall South

as described here: http://stackoverflow.com/questions/29647602/there-is-no-south-database-module-south-db-postgresql-psycopg2-for-your-databa/29937385#29937385

More info here: https://docs.djangoproject.com/en/1.8/topics/migrations/#upgrading-from-south

Cheers,
James

Reply all
Reply to author
Forward
0 new messages