Live data from Hacker News

Django 5.0

djangoproject.com

11–20 of 237 posts

Re: Django 5.0

#11
post #3

Sadly I don't use Django anymore at work but it still has a special place in my heart. The ORM model is the best I've ever worked with and any other always feels clunky with sharp edges to cut you when you hold it wrong. In recent years Django had multiple major releases, I still remember it as being in 1.x forever. Does somebody know what changed within the Django Community that they break backward compatibility mor…

> The ORM model is the best I've ever worked with and any other always feels clunky with sharp edges to cut you when you hold it wrong.

Idk. I have to grant that Django ORM likes to make your life easy, but lazy loading on property calls is a dark pit full of shap punji sticks. Just overlook one instance where this is happening in a loop and say goodbye to performance and hello to timeouts left and right...

Re: Django 5.0

#12
post #7

Another boring release without much innovation. I wonder what's stopping Django from releasing more useful features like other frameworks are doing. Maybe the team is stuck in the past. They've been trying to improve forms for a long time but it still sucks. I think they should just remove it at this point and let external packages solve the problem.

can you list the features you mentioned that is lacking in django?

Re: Django 5.0

#13

Assuming they used Django to publish this, it’s a bit sad that there’s no `generator` tag to give their own CMS a little love. :-/

Django isn't really a CMS. People sometimes group it in with other CMSs because it's good for rapid development of CRUD web applications, but I think most people think about a much higher level tool when they think of a CMS. It's also somewhat limiting – Django is good for building big web applications (see: Instagram, Octopus Energy) not just traditional content management based applications.

Re: Django 5.0

#14
post #6

What's the preferred Python Web Framework these days? I've read a lot of love for Litestar (formerly Starlite), since it seems people prefer it over FastAPI, Flask, etc. https://litestar.dev Or is the preferred web framework still Django?

Depends what you're solving for. Building a website that requires user authentication and basic relational DB... I default to Django. But if I'm building small internal services then I go FastAPI or Flask. Django's ORM is still dreamy.

I used to like DRF (Django Rest Framework) and Django + DRF was a powerful combo to drive single-page-application sites. But DRF can get a little painful if you're not using some of the out-of-the-box classes. Painful as in... lots of code to right and very hard for someone to maintain without knowledge of how DRF magic is made under the hood.

Re: Django 5.0

#15
post #3

Sadly I don't use Django anymore at work but it still has a special place in my heart. The ORM model is the best I've ever worked with and any other always feels clunky with sharp edges to cut you when you hold it wrong. In recent years Django had multiple major releases, I still remember it as being in 1.x forever. Does somebody know what changed within the Django Community that they break backward compatibility mor…

The release process is time-based as to roughly every 8 months[1] with X.0, X.1, and X.2 (LTS). This is mostly to communicate which release has long term support.

The deprecation policy[2] is taken very seriously and Django doesn't opt to break things if it can.

Recently there was a very interesting discussion[3] between the Fellows as to whether the version numbering is confusing as this doesn't follow the same pattern as other libraries.

1: https://docs.djangoproject.com/en/dev/internals/release-proc...

2: https://docs.djangoproject.com/en/dev/internals/release-proc...

3: https://fosstodon.org/@carlton/111300877531721385

Re: Django 5.0

#16
post #6

What's the preferred Python Web Framework these days? I've read a lot of love for Litestar (formerly Starlite), since it seems people prefer it over FastAPI, Flask, etc. https://litestar.dev Or is the preferred web framework still Django?

I've always felt, and this hasn't changed recently, that if you're going to need more than, say, 3 of the cross cutting concerns that Django provides for, then it'll be much more maintainable in the long run to just use Django rather than effectively building a custom solution out of parts. The flip side: if you're building a small internal API that only needs a couple of these, Django might be overkill.

What do I mean by "cross cutting concerns"? I'm thinking about ORM/models, migrations, admin UI, caching, sessions, misc security middleware, user accounts, validation/forms, templating, RSS feeds, logging, testing infrastructure, etc. Django's pieces all fit together well, and any time I've done this with Flask/etc I've found myself spending so much time solving issues gluing these bits together and working around impedance mismatches between libraries.

We had a large Django site at my last place and would just suggest new starters worked through the Django tutorial, because our site basically still worked like that.

Re: Django 5.0

#17
post #6

What's the preferred Python Web Framework these days? I've read a lot of love for Litestar (formerly Starlite), since it seems people prefer it over FastAPI, Flask, etc. https://litestar.dev Or is the preferred web framework still Django?

I know it's not "shiny and new" but Django is still serving us very well were I work.

The only two things it lacks great support of is typing and async. However the async is actively being worked on and does work (with some quirks), and python's type support has only gotten half-mature just recently (coming from typescript at least).

I would personally be hesitant to try something new just because django is so battle-tested at this stage, unless you just absolutely require better async support.

Re: Django 5.0

#18
post #3

Sadly I don't use Django anymore at work but it still has a special place in my heart. The ORM model is the best I've ever worked with and any other always feels clunky with sharp edges to cut you when you hold it wrong. In recent years Django had multiple major releases, I still remember it as being in 1.x forever. Does somebody know what changed within the Django Community that they break backward compatibility mor…

> The ORM model is the best I've ever worked with and any other always feels clunky with sharp edges to cut you when you hold it wrong. Idk. I have to grant that Django ORM likes to make your life easy, but lazy loading on property calls is a dark pit full of shap punji sticks. Just overlook one instance where this is happening in a loop and say goodbye to performance and hello to timeouts left and right...

ORM's always abstract away details, but you monitor for slow queries and slow endpoints and then just fix the issues when they crop up.

Re: Django 5.0

#19
post #6

What's the preferred Python Web Framework these days? I've read a lot of love for Litestar (formerly Starlite), since it seems people prefer it over FastAPI, Flask, etc. https://litestar.dev Or is the preferred web framework still Django?

Jetbrains Python Survey from 2022[1] has Flask, Django, Fastapi dominating the web-frameworks. Not sure how reliable this is, but I also barely see any other frameworks mentioned. So they either are in a totally different bubble, or just not popular (yet).

[1] https://lp.jetbrains.com/python-developers-survey-2022/#Fram...

Re: Django 5.0

#20
post #3

Sadly I don't use Django anymore at work but it still has a special place in my heart. The ORM model is the best I've ever worked with and any other always feels clunky with sharp edges to cut you when you hold it wrong. In recent years Django had multiple major releases, I still remember it as being in 1.x forever. Does somebody know what changed within the Django Community that they break backward compatibility mor…

> The ORM model is the best I've ever worked with and any other always feels clunky with sharp edges to cut you when you hold it wrong. Idk. I have to grant that Django ORM likes to make your life easy, but lazy loading on property calls is a dark pit full of shap punji sticks. Just overlook one instance where this is happening in a loop and say goodbye to performance and hello to timeouts left and right...

> Just overlook one instance where this is happening in a loop and say goodbye to performance and hello to timeouts left and right...

FWIW they do give you assertNumQueries in the testing tools, which makes it relatively easy to catch this as long as you have tests.

Post reply on HN