←back to thread

Django 6.0 beta 1 released

(www.djangoproject.com)
106 points webology | 7 comments | | HN request time: 0.244s | source | bottom
1. pryelluw ◴[] No.45674841[source]
Love me Django and excited about this release. It’s been quite a journey through the years. I started working with it a little before 1.0 and continue to do so. Nowadays as an independent consultant which gives me the ability to really help keep Django systems up to date.

Yes, there’s some rough edges. Like updating can be tricky sometimes, and performance relating to DB queries is a skill in itself, but in general it’s a great framework to build most web software out there.

replies(1): >>45675259 #
2. vecter ◴[] No.45675259[source]
What're some DB query performance issues you've run across in the past and how did you resolve them?
replies(2): >>45675419 #>>45675616 #
3. ranger_danger ◴[] No.45675419[source]
I assume they are referring to the default behavior of the ORM fetching all fields for a model by default, and the frequent need to use select_related/prefetch_related to group your queries into larger ones that are (usually) much faster than making many small queries for related tables.
4. pryelluw ◴[] No.45675616[source]
People generally don’t take the time to learn the framework and miss out on the tooling it provides. select_related for example. If I had a dollar for every project I’ve been hired to work on that didn’t use it, well, I actually do.

Also, people in general don’t seem to be able to do more than very basic SQL, so creating views is seen as a little known performance “trick”.

In general, people who don’t read the manual.

replies(2): >>45676811 #>>45677491 #
5. nojs ◴[] No.45676811{3}[source]
FYI you can avoid the manual sprinkling of select_related somewhat with https://pypi.org/project/django-auto-prefetch/, which avoids the lowest hanging N+1 loops automatically. Definitely not a cure all but it helps.
replies(1): >>45677313 #
6. pryelluw ◴[] No.45677313{4}[source]
Yes, aware of this option. Thanks for posting it!
7. vecter ◴[] No.45677491{3}[source]
Ah yes. That’s the one thing I need to teach everyone when they’re new to Django. I was wondering if there were other quirks to the ORM beyond avoiding N+1 queries.