I'm upgrading an old project running on Django 1.8 to at least Django 1.11 for LTS. I've heard upgrading a django project multiple versions can be difficult and frustrating. I haven't done this, so my question; is it better to do an upgrade per version, 1.8 -> 1.9 -> 1.10 -> 1.11. Or do you advice me to upgrade straightaway to 1.11 from 1.8. Please leave your best thoughts on this and other things I need to keep in mind while upgrading.
Thanks in advance
Go to Settings -> Project Interpreter . Double-click the Django package. Activate the check box Specify version and select the version you want.
See the How to upgrade Django to a newer version guide if you're updating an existing project. Django 1.11 is designated as a long-term support release. It will receive security updates for at least three years after its release.
The upgrade can be difficult, depends on your situation.
First, check the changelog for every version. The goal here is to understand if there is a major change that can affect your code. For example, the on_delete
parameter in the foreign field models was optional, now is mandatory.
If you spot something, just update your code. What can really make the differences are the presence of tests. When we move from python2 to python3 and django 1.7 to 1.11 the tests were our insurance.
We just start to upgrade our code to a different branch using the virtualenv with the new python and new django and just fixing, testing and then merging in develop. If you don't have tests maybe is the right time to write some of them.
I would not suggest you jump directly to django 2.0. Again, if you have tests you can update gradually and then check the deprecation warnings
. Those are very helpful to prepare your code for the next version.
Update
During the process, we check our requirements and revise every package we had in our system to verify the compatibility. We clean up a little bit removing some packages and update some others. Again, if you have tests you have your insurance :-)
Conclusion
Then:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With