Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

edx-platform uses Django. Django is in active development and keeps advancing with continual releases. edx-platform must incorporate these new releases:

https://www.djangoproject.com/download/

Django 1.4 → 1.8

This upgrade was a big project, taking ~5 engineers 4+ months.

For details, view the subpages under this top-level page:

/wiki/spaces/TNL/pages/34013439

Here's the notes from the actual release:

2015-11-17 - Django 1.8 Release

Here's the retro notes:

Django 1.8 Retro

Django 1.9 Upgrade

As of June 2016, Django 1.9 is out and on version 1.9.7. It is not a long-term-support (LTS) release and we haven't made the decision to upgrade edx-platform's Django to it yet. However, it must happen eventually.

Release Changes

https://docs.djangoproject.com/en/1.9/releases/1.9/

Deprecation

In the current Django 1.8 that edx-platform uses, we've eliminated nearly all the deprecation messages that warn us about functionality that will not be supported in Django 1.9. However, one particularly annoying message remained:

In case that's not readable, it's this warning message:

WARNINGS:
wiki.ArticleRevision.ip_address: (fields.W900) IPAddressField has been deprecated. Support for it (except in historical migrations) will be removed in Django 1.9.
    HINT: Use GenericIPAddressField instead.

I first made a branch to get rid of this warning message - this branch:

https://github.com/edx/django-wiki/tree/jeskew/fix_model_deprecation_warning

Unfortunately, it can't be merged and used by edx-platform until "Comprehensive Theming" lands. But it's ready after that happens!

Exploration

The first thing I ran into was this Django 1.9 change:

  • All models need to be defined inside an installed application or declare an explicit app_label. Furthermore, it isn’t possible to import them before their application is loaded. In particular, it isn’t possible to import models inside the root package of an application.

This subtle point means that upon Django startup - when all INSTALLED_APPS are being imported - no models can be imported from the __init__.py of those applications. Unfortunately, edx-platform and its module dependencies do this all over the place.

NOTE: If you're writing new Django apps, do not import models inside the __init__.py (root package) of the application.

After modifying 5+ external Python modules, changing their requirements entries, and changing around the startup.py files, I was able to run the following command to completion:

python manage.py cms --settings=devstack reindex_course --setup

However, when I started up LMS or Studio, I got errors indicating that I had unapplied migrations.

When I attempted a migration, I got errors about importing South in djcelery! What??! Turns out the version that edx-platform uses has some remaining migrations that are pre-Django-1.7? I upgraded djcelery to the most recent version and tried migration again. Got a message about a table already existing. When I compared the existing schema and the new single 0001_initial.py migration in djcelery, the schema did not match. So some tricky database figuring-out will be required to proceed. The next step:

 

  • No labels