Some notes on starting to use Django
42 points by danlamanna
42 points by danlamanna
I feel sorry for people who use a web framework that isn't Django for all kinds of confused reasons.
Could you share what kinds of applications you've worked on using Django and what are the killer features of Django in your opinion compared to other frameworks?
Reposting an old comment of mine:
[...] for a socio-techical reason: Django pushes its users to implement each project component as a self-contained package/directory, and that (a) is a gift to yourself and your team, especially as your application becomes more complex; and (b) has created a thriving ecosystem of actually reusable components.
Not @alper, but experienced with quite a few frameworks in various languages. IME, Django is an excellent framework, it's conservative and middle-of-the-road in terms of features but best-in-class in terms of implementation.
There are few gotchas, the team works hard to eliminate any surprising bugs and while it is explicit about everything, there is somewhat less configuration than other frameworks. No bullshit dependency injection, for example. The language used (Python) matches the framework's style well. Boring yet powerful and common batteries are included.
If I had to pick one I would choose the built-in django admin. If you don't have the need or the time to think and build a frontend for some CRUD actions, it's a treat. At work we use it a lot for internal use, dev or non-dev, to monitor stuff, hacking around, sending an email, trigger some business stuff, etc...
If I had to pick a second, I would say that it's very stable and slow-paced. Some could see it as a drawbacks (and sometimes it is), but most of the time that's a good feature: I know I can stay on a LTS for 3 years and the next LTS won't have many breaking changes anyway.
Oh god yes. I still have nightmares of some Rails, Laravel and CakePHP upgrades I had to do. Especially the latter was horrible when they complete rewrote their ORM with somewhat subtle differences. I don't want to touch that with a 10 foot pole. I mean, it's PHP, so that's somewhat implied, but CakePHP really... takes the cake (scnr).
I feel that would maybe go a bit too far but:
The killer feature of Django is the ORM to the point where I think most people dislike ORMs because they're forced to use one that isn't the Django one.
I've built web apps of arbitrary complexity in Django (including some multiplayer board games) and I've bootstrapped teams without any prior experience to be productive in Django within weeks.
I'm curious, what are "other frameworks" in your question? Battery-included frameworks in other language (rails, symfony, ...)? Other python web "frameworks"
In the comment I was replying to, alper stated "who use a web framework that isn't Django." So I was assuming that he has compared Django to other frameworks, and felt that Django is superior compared to those. (Otherwise, the "feel sorry" part doesn't make sense, because you'd only have data for 1 side of the comparison)
So I'm assuming alper would furnish some concrete examples of how Django is better than XYZ popular framework along specific axes.
I've tried a dozen alternatives and I always come back to Django! Although I sometimes miss JSX when writing templates.
I've heard about django-cotton recently: it's not JSX, but it goes well in the direction of component based templates. (I haven't actually used it, but it's on my todo !)
This comment is super interesting to me because I’m someone who sat out of webdev for a long time because I really disliked web frameworks on the whole. Most of them seemed to operate at low levels of abstraction and didn’t aspire beyond that. They’re often mostly stringly typed. And they usually need a zillion dependencies which feel like a cottage industry. All of this created a lot of cognitive load which kept me away.
Been getting along okay with Astro lately. But ORMs in Node just aren’t at the caliber of, say, EF Core.
Regarding the 'the settings file still feels like a lot", I agree a lot !
I really hope that in a near future Django will accept to add type annotations and typecheck them to some parts of their codebase (like settings, HttpRequest, HttpResponse, View, etc..): it would help tremendously with autocompletion, discoverability and it will avoid the mess to have multiple stubs implementations that do not behave the same (django-stubs, django-types).