Maintaining old django code

63 views
Skip to first unread message

Lekan Wahab

unread,
Sep 6, 2016, 4:23:00 AM9/6/16
to django...@googlegroups.com
Good morning guys.
I was handed a project at work which was written as far back as 2012.
Quiet a lot of the packages used in the project are either no longer being maintained.
Rebuilding the project from scratch is not option.
There are way too many moving parts and way too many apps to rebuild it.
Here are my questions:

1. In the scenario i am in, what would be the best approach to update this project or at least get it set up locally?
2.  Quite a lot of changes have been made between django 1.4 (which was originally used) and the current version(1.10), what would be the best version for me to update the project to.
I mostly use 1.8 anyway.
3. Is there anyone who has or who is still using *unobase* here?


Olamilekan

Erik Cederstrand

unread,
Sep 6, 2016, 4:58:31 AM9/6/16
to Django Users

> Den 6. sep. 2016 kl. 10.20 skrev Lekan Wahab <olam...@gmail.com>:
>
> Good morning guys.
> I was handed a project at work which was written as far back as 2012.
> Quiet a lot of the packages used in the project are either no longer being maintained.
> Rebuilding the project from scratch is not option.
> There are way too many moving parts and way too many apps to rebuild it.
> Here are my questions:
>
> 1. In the scenario i am in, what would be the best approach to update this project or at least get it set up locally?

First, get the project to run on your local machine with the exact same package versions as was specified originally. You may have to look in lib/pythonx.x/site-packages on wherever it was running before, for the exact versions used, if there is no requirements file. Run the test-suite for your project and make sure everything is working.

Second, write more tests! You need lots of tests to verify any future changes you make to your own and external packages.

Third, either upgrade external packages to the newest versions, find alternatives if they are no longer maintained, or maintain the external package yourself from now on (assuming the license permits, of course). If the packages depend Django, you may have to do this gradually, as the newest package versions may no longer support Django 1.4 (see below).

> 2. Quite a lot of changes have been made between django 1.4 (which was originally used) and the current version(1.10), what would be the best version for me to update the project to.
> I mostly use 1.8 anyway.

Take one minor Django version at a time, reading the upgrade notes along the way. Update your code to the new way of doing things, and move on to the next version. That's the supported and recommended way. Even though that's six versions to upgrade to, it will probably save you time in the long run instead of upgrading from 1.4 -> 1.10 in one go.

Happy coding!

Erik

Andreas Kuhne

unread,
Sep 6, 2016, 5:12:48 AM9/6/16
to django...@googlegroups.com
This is probably a requirement - to do each minor upgrade. I don't think it is possible to migrate from 1.4 to 1.10 directly. There are too many deprecations for that. That being said, shouldn't it be possible to migrate from one LTS to another? And if memory serves correctly, 1.4 should be an LTS?

Regards,

Andréas

Michal Petrucha

unread,
Sep 6, 2016, 5:41:31 AM9/6/16
to django...@googlegroups.com
I think that this policy will only apply from 2.0 on [1] – back when
1.4 was supported, this new backwards compatibility policy was still
just in the works, and the usual “two releases” policy applied. So no,
at the very least, when going from 1.4 to 1.8, you should make an
intermediate stop at 1.6, but if you want to minimize the pain, going
through every single feature release would probably be the best idea.

[1]: https://docs.djangoproject.com/en/1.10/internals/release-process/

Cheers,

Michal
signature.asc

Andromeda Yelton

unread,
Sep 6, 2016, 10:08:15 AM9/6/16
to django...@googlegroups.com
+1 to Erik's plan.

In deciding whether to stop at 1.8 or go all the way to 1.10 I'd ask myself the following questions:

* Are there features from 1.10 (that aren't in 1.8) that I'd really like to have? (channels is the big one for me)

* Are there important third-party dependencies that are only available for 1.8 and/or 1.10? Do those dependencies have a track record of keeping up with new versions?  (https://djangopackages.org/ is indispensable here, and will also help you find replacements for your unmaintained dependencies.)

* Given that there hasn't been much maintenance time budgeted in the past, is there likely to be much maintenance time budgeted in the future? (if not, I'd stick with 1.8, since that will be maintained longer than 1.10 - a better place to be stuck at if you can't upgrade for a while. but if you're going to have time to keep up with versions as they happen, then the questions above are more important.)

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAE6v7ocNHTh-MUepU1qKp_ZKVc8ofOuDFwebq37KWgqsG7i9Fg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
Andromeda Yelton
Vice President/President-Elect, Library & Information Technology Association: http://www.lita.org

bobhaugen

unread,
Sep 6, 2016, 10:53:13 AM9/6/16
to Django users
We migrated a huge codebase from 1.4 to 1.8 like this:

Might give you some clues. Short version: one release at a time.

Andreas Kuhne

unread,
Sep 6, 2016, 3:44:19 PM9/6/16
to django...@googlegroups.com
2016-09-06 16:07 GMT+02:00 Andromeda Yelton <andromed...@gmail.com>:
+1 to Erik's plan.

In deciding whether to stop at 1.8 or go all the way to 1.10 I'd ask myself the following questions:

* Are there features from 1.10 (that aren't in 1.8) that I'd really like to have? (channels is the big one for me)


One thing I would like to add here is that 1.9 is faster than 1.8 on OUR codebase. So a migration from 1.8 to 1.9 speeds up our site....
 

For more options, visit https://groups.google.com/d/optout.

Regards,

Andréas 

Reply all
Reply to author
Forward
0 new messages