> 3. Actions It is somewhat explained as a convention or something built-in, but I can't find much about it elsewhere. Is it the author's own convention or am I missing something?
What I love about Django
31–40 of 120 posts
Re: What I love about Django
#32Re: What I love about Django
#33I really like the ORM and the migrations, but some parts I really dislike. They're maybe not Django's fault, but how it's used most places: * Models being passed around everywhere, queries happening everywhere. I prefer having a dedicated service/selector layer to do those things. Then convert to pydantic objects or something that's passed around further. * Corollary, but adding stuff to querymanagers quickly goes ou…
Re: What I love about Django
#34I agree, Django is just fantastic. Nothing is perfect, but Django is just really well-designed, with components that fit together naturally into a balanced whole.
Just wanted to say I saw your last stand up , you're hilarious!
Re: What I love about Django
#35I really like the ORM and the migrations, but some parts I really dislike. They're maybe not Django's fault, but how it's used most places: * Models being passed around everywhere, queries happening everywhere. I prefer having a dedicated service/selector layer to do those things. Then convert to pydantic objects or something that's passed around further. * Corollary, but adding stuff to querymanagers quickly goes ou…
I seriously don't get why Django ORM is using the Active Record pattern. This is such a stupid footgun that trivially causes horrible performance and BEGS you to cause n+1 problems. Never in my life did I have a problem with lazy loading causing unbearable performance until I joined a Python Django team. I really tried to find sympathy for the "dynamically typed" folks (please spare me saying Python is technically st…
select_related, prefetch_related. n+1 problems be gone.
Re: What I love about Django
#36I remember, when I used it for the very first time in commercial project. Client briefed me in the afternoon, the next day, before the noon, she got ugly app, but with fully working admin backend. She was sold. But I also remember, that some non-standard requirements were really difficult to implement or get around. Having that in mind, the next project was entirely in Pylons. All was good, until we were asked to add…
How long ago was this? I feel like unicode has kind of been a solved problem in Python since python3 came out. In the python2 days it was, indeed, miserable.
Re: What I love about Django
#37I really like the ORM and the migrations, but some parts I really dislike. They're maybe not Django's fault, but how it's used most places: * Models being passed around everywhere, queries happening everywhere. I prefer having a dedicated service/selector layer to do those things. Then convert to pydantic objects or something that's passed around further. * Corollary, but adding stuff to querymanagers quickly goes ou…
I despise django-orm, doctrine is so much better. Like, who thought that using named arguments to do stuff was a proper way ??? `.filter(created_at__gte=XXXXX)` why? The rest of the framework is great but the ORM is definetly its weakest point.
Re: What I love about Django
#38I really like the ORM and the migrations, but some parts I really dislike. They're maybe not Django's fault, but how it's used most places: * Models being passed around everywhere, queries happening everywhere. I prefer having a dedicated service/selector layer to do those things. Then convert to pydantic objects or something that's passed around further. * Corollary, but adding stuff to querymanagers quickly goes ou…
I seriously don't get why Django ORM is using the Active Record pattern. This is such a stupid footgun that trivially causes horrible performance and BEGS you to cause n+1 problems. Never in my life did I have a problem with lazy loading causing unbearable performance until I joined a Python Django team. I really tried to find sympathy for the "dynamically typed" folks (please spare me saying Python is technically st…
I've seen the horrors Java devs start doing on a Python project when trying to "fix" things, where by "fix" they mean use patterns they had to in previous gigs.
It's a different world.
Re: What I love about Django
#39I really like the ORM and the migrations, but some parts I really dislike. They're maybe not Django's fault, but how it's used most places: * Models being passed around everywhere, queries happening everywhere. I prefer having a dedicated service/selector layer to do those things. Then convert to pydantic objects or something that's passed around further. * Corollary, but adding stuff to querymanagers quickly goes ou…
Re: What I love about Django
#40(1) It seems whenever I need to adjust how something works, there is some field or method, that I can override, or meta class attribute to set. None of it seems too inflexible. Overriding or changing how things work somehow always feels like someone already thought of this special case I have, and has made it mostly easy to do. Often when I have such a customization case, I have this feeling: "AH, that's how it is supposed to be done in Django." instead of having a feeling of having to fight the framework.
(2) Just being able to use a normal template engine (I always use Jinja2 with Django), instead of having some wannabe HTML lookalike thing. I don't want to have to encode control flow inside HTML attributes. Why then make it look like HTML in the first place, if some JS framework then picks it apart? It is unnecessarily cumbersome to do that, and Django doesn't engage in that.
(3) The ORM is good, and flexible. Some traps for many queries though. But also escape hatches, which let one write ORM calls, that will translate to efficient SQL in most cases.
(4) Django makes it so easy (comparatively) to write a phenomenal searching and ranking function for ones database entities. Check for example the code of my blog [1]. One page of code, very adjustable to ones needs.
(5) Handling of routes is easy. `reverse` is very useful to not have to hardcode routes.
(6) Even when using third-party things like django-allauth it is easy to override templates, without having to modify the dependency itself. With foresight there exists a way to put ones own templates in a place that is discovered before the other package's templates.
(7) Adjustable django admin. I often have some "Tags" in my models, which are many-to-many. For example Posts-TagAssignment-Tag, where TagAssignment is a "throught table". In Django admin one can have a nice little modification [2] to make a very usable widget appear for assigning tags.
In short: It very much gets out of ones way.
[1]: https://codeberg.org/ZelphirKaltstahl/django-website/src/com...
[2]: https://codeberg.org/ZelphirKaltstahl/django-website/src/com...