News for hackers. Stuff that matters.
Re:Django 4.2 Released by surfingdino on Monday April 03, 2023 @03:51PM (#35430267)
Django's hidden powers are its highly customisable admin UI and ORM. Add to it Django REST framework and you have a solid backend for a wide category of web apps, from the old pre-XMLHttpRequest apps to SPAs. Flask or FastAPI get you going fast, but you quickly realise that you have to write a lot of the code that comes with Django for free.
Re:Django 4.2 Released by hooverd on Monday April 03, 2023 @03:58PM (#35430363)
I personally prefer Django Ninja over DRF for APIs, it's all the good parts of FastAPI mixed with Django.
Re:Django 4.2 Released by zach_garwood on Monday April 03, 2023 @05:29PM (#35431548)
Honestly, I think the generic and model views are way more impressive than the ORM or the admin. They take away all of the boilerplate usually associated with CRUD apps.
Re:Django 4.2 Released by luxcem on Tuesday April 04, 2023 @05:00AM (#35436937)
I've used them for quite a while but came back to the old function views. The Generic Views are a mess to understand, the hierarchy tree gets so complicated. See for example : https://ccbv.co.uk/projects/Django/4.1/django.views.generic.... there are 9 classes in the inheritance tree. For every slight change from the default behavior you need to research the documentation, find which method to override…

In the end I have to write a bit more of boilerplate each time (and with tools like copilot it's a non-issue) but it's 10x faster to understand what a view does and how when reading code.

Re:Django 4.2 Released by Nextgrid on Tuesday April 04, 2023 @06:51PM (#35446915)
> For every slight change from the default behavior you need to research the documentation, find which method to override…

I just use an IDE which allows me to Ctrl+Click into any symbol and see its implementation and underlying classes (and do so recursively if needed). That saves me from having to lookup the documentation all the time.