What is the best way to upgrade a django project from 1.3.7 to 1.6 or 1.7

I have a Django project that needs to be updated. Should I continue by creating a new project on 1.6 and moving one by one from Django 1.3 to 1.6, or is there some other easy way?

+3
source share
1 answer

What recommends follow the steps

  • create a new virtualenv, install a new version of django in it with all the necessary dependencies for your application. Thus, you save it separately from the old version.
  • create and run a test suit . Ensure that you -Wall test with the -Wall for invalid warnings.
  • When deploying, make sure you clear the cache

More personal note:

From my experience, I also recommend that you go to the release notes , go one version after another, and scan the main changes. Although some things are still supported and will work for you, this does not mean that one of the newer versions did not show a better way to do the same.

A good example is render . It was introduced as an alternative to render_to_response back in version 1.3, but it did not catch it quickly. render_to_response is still supported, and there are no deviations . But it's still a good habit to travel with time.

Another personal suggestion is to recreate applications with the new version of django, and then copy the files. This is because new versions use different templates for their settings.py parameters and other files, and this may immediately highlight some of the changes made to you (for example, ALLOWED_HOSTS , which was introduced in 1.5).

Good luck Hope this won't be too painful.

ps - think about waiting a little longer - Django 1.7 is coming soon, and it is expected to be the biggest release with Django 1.0 . Although, on the other hand, upgrading from 1.6 to 1.7 is likely to be easier than upgrading from 1.3 to 1.7. I'm not sure the best course is here, but think about it.

+9
source

All Articles