Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a quick way to automatically update a Django project to the next major version?

Tags:

django

So Django 1.5 will be out within an Internet-Week (soon) and I'm feeling the pressure to start playing around with it for its vastly improved User model. But like with 1.4 and 1.3 before it, upgrading is not simply a virtualenv change, I've needed to alter (quite heavily in places) the structure of my projects.

I recently jumped from 1.2 to 1.4 and spend hours (over many projects) updating their file structures (and settings) to mirror modern Django preferences. Django 1.5 is going to force me to go through and fix all the CACHE settings and fix practically every instance of {% url ... %} in my templates.. I'm wondering if there's an easier way.

Is there anything out there that can automagically "upgrade" a Django project?

... Or at the very least "scan" a project to show up the larger honking issues so I can kick those out before starting QC.

like image 553
Oli Avatar asked Feb 25 '13 13:02

Oli


People also ask

How often is Django updated?

Django uses a time-based release schedule, with feature releases every eight months or so.


1 Answers

No. And for good reason.

Some of the changes between versions are minor (such as the whole quotes around variables thing), while some are major (like the new User model).

While automatic detection might be possible (though non-trivial considering you'd have to execute every possible code path in the app), changing them would be fragile. And possible very dangerous.

Instead, when moving between versions, I move up one version (to the last minor version in for that major) at a time and test. Django will issue warnings for features that will be removed between versions, so it's easy to catch them while still having running code that works.

like image 155
Jack Shedd Avatar answered Nov 11 '22 15:11

Jack Shedd