Refactoring legacy Django app using OOP

Sebastian Buczyński

Clean Code TDD legacy-code

See in schedule: Wed, Jul 28, 10:30-11:15 CEST (45 min)

Every year we can hear rumours about the demise of Object-Oriented Programming. As usual, they are greatly exaggerated. In 2021 OOP still has a lot to offer. The problem is a shortage of good quality materials that would show where it shines and how a Pythonista can leverage it without writing code that looks like Java from the 00s.

I'll show you how you can refactor legacy code in a Django app and tame complex logic living there.

Value for attendees: see refactoring possible directions and get to know 3 OOP stereotypes
Level of attendees: intermediate & advanced
Expected knowledge: Experience with building web apps, at least superficial knowledge about Django

This talk is an introduction to 3 out of 8 OOP Stereotypes, i.e. Controller, Interfacer and Information Holder. They'll be introduced using a real-life legacy project refactoring.

For the purpose of this talk, I'll be using code from this repo:

Type: Talk (45 mins); Python level: Intermediate; Domain level: Intermediate

Sebastian Buczyński


I am a Pythonista with almost a decade of professional experience. I am in love with software engineering and value good code and even better tests.

I worked for a variety of companies - those with their own SaaS product or consultancy companies. Currently, I'm working with Webinterpret to support growing international e-commerce sales.