[Django]-What is the best method to upgrade a django project from 1.3.7 to 1.6 or 1.7

9👍

What the documentation recommends, do it in steps

  1. create a new virtualenv, install the new django version in it with all required dependencies for your app. That way you keep it seperated from the old version
  2. create and run a test suit. Make sure you run the test with the -Wall command to unsilence warnings
  3. When you deploy, make sure to clear your cache

A more personal note:

From my experience, I also recommend you go to the release notes, go one version after the other, and scan the major changes. While some things are still supported, and will work for you, it doesn’t mean that one of the newer version didn’t present a better method to do the same thing.

One good example would be the render. It was presented as an alternative to render_to_response back in version 1.3, but it didn’t catch on that fast. The render_to_response is still supported, and there isn’t any deprecation coming. But it’s still good habit to get with the times.

Another personal suggestion – recreate the apps with the new django version, and then copy the files. That’s because the new versions use different templating for their settings.py and other files, and it might immediatly highlight to you some of the changes that were brought (such as ALLOWED_HOSTS which was presented in 1.5).

Good luck! Hope it wouldn’t be too painful

p.s. – consider waiting a little while longer – Django 1.7 is coming soon, and it’s expected to be the biggest release since Django 1.0. Though, on the other hand, upgrading from 1.6 to 1.7 will probably be easier than upgrading from 1.3 to 1.7. I’m not sure what’s the best course here, but consider it.

👤yuvi

Leave a comment