0

I'm having an extremely tough time out there in trying to upgrade a Python 2.7/ Django 1.6.5 application to a Python3.x/Django 1.8.x web application.

To make matters worse, I also have a big django-cms dependency, which is required to upgrade from 3.0.2 to 3.1.3. I've started making my code Python3 friendly, upgrading the requirements file to the latest Django (plus dependencies), and then tried the footsteps described here: http://django-cms.readthedocs.org/en/latest/upgrade/3.1.html#upgrading-django-cms-3-0-to-3-1.

When I run the first command, I run into a Django exception (django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.), although my WSGI handler is correct, as described here: Django 1.7 throws django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet.

Anyhow, this was one of the approaches. In another approach, after making the code Python3 friendly, I tried upgrading from the South migrations to the Django contained migrations, and it worked for my apps, until reaching huge database inconsistencies regarding the tables from django-cms: entire columns present in the migration, but not present in the database, missing columns and so on and so forth.

I know this might me too much to digest at the time, but what can I do? Is there a correct way to address this issue?

Community
  • 1
  • 1
  • 1
    Upgrading can be tricky, and involves going carefully through the release notes of each dependency that you are upgrading. Stack Overflow might be able to help with individual issues, but there isn't a definitive guide that can tell you how to upgrade your project. I'd recommend trying to upgrade as few things at once as possible. You can run Python 2.7 and 3.2-3.4 on both Django 1.6 and 1.8, so don't try to upgrade both at once. You'll probably find the Django upgrade easier if you do 1.6 -> 1.7 -> 1.8. Good luck! – Alasdair Oct 07 '15 at 16:34
  • 2
    I'd stay the heck away from doing Python 3 upgrade until you are settled & stable on the new django/django-cms versions. Key success factor is changing one system at a time, so you know where to look in case of problems. Not least because all Python package/app you are using need to be 3.x ready. – JL Peyret Oct 07 '15 at 16:35
  • I made a mistake, Django 1.6 supports Python 3.2 and 3.3 but not 3.4. However my and @JLPeyret's advice about upgrading one thing at once still stands. – Alasdair Oct 07 '15 at 16:42

1 Answers1

1

I'm having an extremely tough time out there in trying to upgrade a Python 2.7/ Django 1.6.5 application to a Python3.x/Django 1.8.x web application.

I also have a big django-cms dependency, which is required to upgrade from 3.0.2 to 3.1.3

I would suggest going from "easiest" to "hardest". A migration from Django 1.6 to 1.8 will be expontentially easier than upgrading from Python 2.x to 3.x, simply because Python 2 and Python 3 are wildly different in some parts.

So with that in mind:

  1. Upgrade django from 1.6.5 to 1.6.11 - this should be a trivial step, but is required because django-cms v3.1.x requires django>=1.6.9
  2. Check everything works
  3. Upgrade django-cms from 3.0.2 to 3.1.3 - this should be a straight forward pip upgrade
  4. Double check everything works
  5. Upgrade django from 1.6.11 to 1.8 - this will be hard, and some things in django 1.6 might not be there any more. Just pip upgrade and hammer down bugs as you find them.
  6. Triple check everything works
  7. Upgrade python from 2.7 to 3.x - this will be nightmarish, 2to3 and six might help with this, but not much. Pray.
  8. Quadruple check everything works

That last step will undoubtedly be the hardest and have the most potential to break things. The earlier ones are more straight forward upgrades. But do not progress until you are certain your code works at every step of the way.

Community
  • 1
  • 1