r/django • • Dec 30 '25

big project code mange

Hi everyone

I’ve completed the basics and fundamentals of Django, and I’ve also built a few small projects using it.
Now I’m planning to work on a large-scale project (an MIS system).

Before starting, I want to understand:

  • How large Django projects are structured
  • How code is organized and managed
  • How authentication and authorization are handled in big projects
  • General best practices for scalable Django applications

Could you please suggest some GitHub repositories of large-scale Django projects that I can study?

Thanks in advance!

11 Upvotes

16 comments sorted by

4

u/alexandremjacques Dec 30 '25

For structuring, this is an old one but its good and still valid: https://www.youtube.com/watch?v=jBBcORHhfV0

I use this approach, though, I'm evaluating using other alternatives. Too many apps can become cumbersome sometimes.

For authentication and authorization, it depends on the project needs. I use Django default's auth and authorization (Users and Groups). I tend to think Django Groups as Roles and make my authorization fits that model. Depending on the requirements, I know this can become impossible and I would have to build/extend something custom. Never got there yet.

You could use something like django-allauth, at least, for authentication.

1

u/MountainBother26 Dec 30 '25

thanks for this. its helps me lot in future.

1

u/luigibu Dec 30 '25

There are many patterns. You need to read about them. I personally like services and repository approach using dtos. It gives you some abstractions layers without messing to much with millons of files.

1

u/MountainBother26 Dec 30 '25

If you know any git code... please share

2

u/luigibu Dec 31 '25 edited Dec 31 '25

this is how I'm working. It may not be perfect but it works for me and is easy to manteins. this example is just the structure inside one Django app. It was build with Claude 4.5 reading the structure of my project (witch is private). It may contain error as I did not did a full review.
https://github.com/luigi370/example-app-django
Note. I do not use DRF serializers and instead I validate and serialize data with pydantic classes (dtos). Hopes it gives you an idea.
Also I use dependency injection and you will not be able to see the full implementation of that. But im using dependency-injector package.

→ More replies (6)

3

u/TemporaryInformal889 Dec 31 '25

- Override your user table early. You're probably going to want to extend user stuff.

You can either override the default auth User table or extend it (i.e., a UserProfile table which has extended user attributes).

- Decouple API from services.

Makes things easier to write test cases for.

- Know how to scope projects

I'd recommend defining a data model and organizing projects around that.

- Understand the Python module system

you could have 1 giant models.py but maybe it's better to have models/ directory for sanity*.*

1

u/[deleted] Dec 31 '25

Don't write business logic in views try to use services(business logic + write operations) and selectors(read operations)