What I love about Django
The author reflects on why Django remains a favorite framework after years of building Buttondown, praising its invisible structure and the long-term leverage of middlewares, model inheritance, actions, and simple views. They also discuss what they deliberately leave out—signals, class-based views, apps, and forms—and explain their choice of Django for its boring reliability.
I do not look at Buttondown and see a Django app; I see a well-structured codebase with many things that have been solved by smarter people than myself.
- matsemann
I 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 out of control. Sure, it's nice to reuse MyModel.objects.annotate_something().annotate_something_else().... but it can quickly become unwieldy and even wrong with exploding joins. And it promotes doing queries in places they shouldn't happen.
* It's veeery easy to make spaghetti. Very easy to query across boundaries, into other apps. Fine on smaller projects, but in huge codebases it quickly makes things hard to control, especially since it's all stringly typed. If I want to modify my model, it's hard to know if someone else have done a query where they did theirmodel__some_relation__another_relation__mymodel__some_field. Blows up in production.
* For some reason it's very common in Django/python projects to have types.py, models.py, selectors.py, views.py, services.py etc. And then each of those end up with lots of unrelated things in the same python file, while related stuff is spread over many files. Django apps doesn't really solve this cleanly either.
- JodieBenitez
Most loved feature, for me: No dramatic changes, just sane and careful evolution.
- saaspirant
Django for Startup Founders: A better software architecture for SaaS startups and consumer apps: https://web.archive.org/web/20210624040717/https://alexkrupp...
This article is very useful.
I use DRF but not serializers and write validations by hand because it is too abstract for me.
My views just call services and return the result.
- daft_pink
I like Django too, but find it difficult to deploy. While frontend frameworks can be easily deployed via a cdn and some microservice backends on something like cloudflare or aws, I find Django very difficult to deploy because it needs an underlying server running 24/7.
- dzonga
Django while opinionated is very flexible too. unlike Rails.
that means you can mold it to fit your use case easily - don't like the ORM - you can plug SQLalchemy and use a different 'architecture'. + you can use multiple different databases if you think that's the right path. in Django there's no 'the rails way' - you choose your own path.
Django-admin by itself saves so much work specially If you're doing B2B stuff & you gotta onboard users.
I guess Django is not the best thing, but not the worst thing either. so a perfect middle ground.
- stuaxo
Nice.
I've been meaning to do my own Django post, on some other bits we take for granted - I should do it.
People should be using Django, the best parts are so useful you don't notice them until you switch platforms and implement them badly.
Every app that used a more narrow solution ultimately ends up implementing parts of Django badly.
The best way to solve this from Djangos side would be to have official ways of:
- Using the ORM outside of Django
- Doing single file Django apps
Both of these have various 3rd party solutions, which shows demand.
In the past other bits of Django have been split off by 3rd parties but those two are the places to start.
- Klonoar
I feel sufficiently old after having read South in this article. Good god what a throwback.
Django is hands down one of my favorite frameworks ever created, and the only one I still reach for in some contexts. For a lot of projects I use it to drive database migrations, and stand up an easy admin portal for others to use - then anything else is driven by an API layer written in (e.g) Rust.
I haven't had to care about Django's performance in years but still get to reap some of the benefits.
- fmind-dev
I'd love Django, if they had a better async story ... I used it for a recent project. While the framework is overall amazing, I had to switch to Go for better performance and easier async support.