2 ms·
I have this same question and also work in Django, so I think I know what OP is asking about. Django's code leans heavily into advanced Python features like me
by hkhanna 4y ago
I have this same question and also work in Django, so I think I know what OP is asking about.
Django's code leans heavily into advanced Python features like metaprogramming. To use Django, you don't need to understand it, but once you start customizing things or building on what Django provides, you need to read through Django's code to understand it. And if you don't know things like metaprogramming, you'll get lost quickly.
There's not a lot of great resources for intermediate Python developers to learn these concepts. I tried reading Fluent Python but found it difficult to follow. I then checked out Learning Python 5th Ed., which is a little dated at this point, but has some good chapters on metaprogramming at the end.
That's basically how I started to get my arms around these advanced Python features to be able to understand Django's codebase a little better.
- rlawson 4y agoI am working through Fluent Python as well but it's a long slog. Most of my Django code is dead simple from a Python perspective (altho quite complicated use of the ORM, etc).