Structuring large/complex Django projects, and using a services layer in Django projects

Hello everyone,

I’m sorry for bringing this topic back to life, just wanted to add some context.

First - there are a lot of great ideas & suggestions here. Kudos :raised_hands:

The important takeaway seems to be - people should use whatever makes sense to them & their teams.

As for the mentioned styleguide - this is what ended up working for us, for the past 8 years of developing Django projects. And it works on a big scale projects.

Sometimes, the service layer is not always looking like a single file with a bunch of functions, but rather like an entire Python module with well-defined interface, so we can encapsulate something complex & isolate it from the rest of the app.

We’ve even gone further creating a layer of types, between the ORM & the business logic (this is an overkill for most cases, but there are cases where it helps)

The general idea - separation of concerns - is key.

Additionally, we are constantly adding (well, at least for the past year) new things to the styleguide, as we learn them & see them in action.

There’s still a lot to add to the styleguide, of course, but we are getting there.

Right now, we are running a survey, to gather some feedback and know what to improve.

Again, kudos for the valuable feedback & points of view.

BTW, if someone wants to discuss the related ideas, I’m more than happy to do so. Perhaps it’d be best to do so on some kind of a call.

Cheers!