How do you handle working on a legacy Django codebase with old patterns or an outdated version?
Show that you can upgrade incrementally rather than proposing a rewrite, since the rewrite answer is what most interviewers are screening against.
- Get the tests and the pipeline working first. You cannot safely change anything without a way to know you broke it. If there are no tests, add characterisation tests around the areas you must touch.
- Upgrade one minor version at a time. Run with
-W error::DeprecationWarningto surface what the next version will remove, fix those, then step forward. Jumping several versions at once turns a series of small problems into one unsolvable one. - Prioritise by risk, not by ugliness. An unsupported Django version with open security advisories is urgent; a fat views file is not.
- Improve code you are already touching. Refactoring in the course of feature work is far easier to justify than a standalone cleanup ticket.
Note: Be explicit that you would document the upgrade path and its blockers before starting. Legacy work fails most often through lack of a plan, not lack of skill.





