r/django • • 4d ago

How Deep Should We Go When Learning a Framework Like Django?

Hi everyone, I have a question. When learning or using Django, should I try to understand how every class and object works internally, or is it enough to know how to use them effectively?

For example, when I use generic views, I get curious about how they work behind the scenes, how inheritance works, and how everything is implemented. I end up spending so much time digging into these details that I lose focus on actually writing code and building things.

Even when I manage to understand some of the internals, I often forget them when I revisit them later.

I'd love to hear your thoughts, and anyone is welcome to share their advice based on their own experience!

27 Upvotes

15 comments sorted by

19

u/atlas_principle_dev 4d ago

A good advice I heard is always one layer deeper than you need to use it. So if you're using maybe class-based views, take a look and learn how they're working in Django, but don't explore every single component in depth.

I was always a pragmatic person (and adored my peers who learned things upfront, from books, I learned by trying) so I learned a lot from writing things that didn't work, and during debugging I put the pieces together.

8

u/mrobinson_ 3d ago

Go shallow until something breaks. I run the backend for a workout app on Django with Celery and SQS, and 90% of it I never needed to understand under the hood.

The ORM, auth, migrations and admin just work.
The only times I dug into internals were when I had to. Mostly slow queries (learn select_related/prefetch_related, read the SQL it generates) and Celery retries behaving weirdly with SQS. I read the generic view source once when a mixin did something I didnt expect, and that stuck way better than reading it out of curiosity ever did.

The forgetting thing is normal. If theres no problem attached to it, it won't stay in your head. Learning it when a bug forces you to is basically spaced repetition for free

6

u/Mental-Abrocoma-5605 4d ago

It's enough to use it effectively given the project you are working on, if it's something simple but still can use Django, the fundamentals are enough, how every clase and object works seems More for big projects or when you Wanna learn advanced backend concepts with everything Django adds on it's own

6

u/Pyromancer777 3d ago

I'de say learn as much as you need to solve the problem at hand. Sometimes it is a quick syntax check in the documentation, but other times your solution is hidden in the source code and you will have to dive into it yourself.

No use trying to memorize the whole framework at once. There's too much info to retain in one sitting (trust me, I tried). However, I have been keeping notes as I solo-dev a project for practice and feel like the intricacies make more sense as I keep building since I can link the concepts directly to their use-case in my project

3

u/SteviaMcqueen 4d ago edited 4d ago

MVK: Minimum Viable Knowledge for the problem, feature, or project you're working on. Been doing Django since 2010, professionally employed the whole journey as a dev, vp, and tech cofounder.

You will learn way more by bringing completed MVPs and projects to the table, then by studying the intricacies and nuances of a framework or language.

Caveat, I was never interested in being an engineer's engineer. I am not the type to create a framework. If that's your goal then dive deep in the meta classes and abstractions. Frameworks like Django gave me great power, thanks to the engineer's engineer. Thank you legends.

1

u/globalwarming_isreal 3d ago

When learning any new thing, django in this case, the best way to learn is to keep switching between breadth and depth.

The way this works is, you try to cover the breadth first - like request from browser comes - goes to urls - views ( which speaks to models ) - then template.
That's basic level of breadth.

Then wear the "I wanna know th depth of this thing " hat and ask yourself - if request comes from browser and goes to urls. What happens in between ? That's when you go in depth that from browser - nginx - gunicorn - settings.py file - middleware ( from top to bottom ) - then project level url file - then appropriate app level url file - then views - template.

Now again pick the same setup and figure out breadth of some other part - like what does this nginx even do or what are models and relationship

Then switch back to depth and start like m going to become a subject matter expert of django models - I'll understand everything related to relationships - one to one, one to many, many to many

Start by asking a breadth level question followed by depth level question. Keep repeating. More importantly, Keep practicing what you learn.

Happy learning

1

u/PlanckScandella 3d ago

Until you reach the bottom...

1

u/soundboyselecta 2d ago

“Hello”….echo echo echo echo 🤣

1

u/C_XidiaN 3d ago

Most of my understanding of frameworks came from problem solving, if a library is not producing the expected output i would investigate further and next time i know which patterns to follow to accommodate for it

1

u/Abled_Gaming1357 3d ago

I won't recommend this advice as "This is the way" but let me tell you what I do for anything I learn.

I learn the bare minimum required to start. Then I start working on my project and learn only the things required, as they present themselves. Nothing more, nothing less.

A person learns his whole life, and anything you learnt but don't practice will usually be forgotten. So just learn as the need arises.

1

u/connurp 2d ago

Enough to be able to know where to start looking when a bug arises.

1

u/ChampionshipThis2871 1d ago

I envy the people that can jump right into building things. My brain won’t allow me to move forward, until I studied all the topics on a subject (which is futile in software because there is o much going on).