Live data from Hacker News

Django 5.0

djangoproject.com

161–170 of 237 posts

Re: Django 5.0

#161
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?

If you are doing something that is basic CRUD (which, to be honest, is most of the business world, although it's not very sexy), then Django is the best. If you want to do something that doesn't fit very well into that idea, then Flask is good for "just give me a web wrapper and get out of my way".

Re: Django 5.0

#162
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…

> However the async is actively being worked on and does work (with some quirks)

I recently tried to implement it in a project using the new ORM a-methods (which AFAIK are not even async under the hood) and it resulted in an explosion of complexity bubbling up in many places in the codebase. I reverted everything to sync and re-implemented the hot functions with multi-threading... I think I'll keep to this approach until I see some good guides, codebase examples, and overall feature maturity.

Re: Django 5.0

#163
post #22

My app is a Django backend and a Vue frontend. There are large swathes of Django that I ignore, but to me the core of Django — its ORM, routing and middleware system, and admin interface — are worth their weight in gold. The migration from DRF to Django-Ninja (which is, roughly, FastAPI + Django) has also been a great improvement in terms of productivity and performance. Not a lot of whizbang features in 5.0, but Gen…

GeneratedField looks interesting, but I'm not _really_ sure what gains I get over just calling annotate() on my queryset with some computed fields. At least on the backends where the computed GeneratedField isn't stored.

It's a generated column in the database, vs. annotate is just a python alias for something you're selecting in the query.

Re: Django 5.0

#164
post #76

Earlier quoted context omitted.

> It’s so strange people still use rails Why? What makes Django better? (Genuinely curious.)

I never used Rails, but people who use both said that thy were pretty similar. Python had the advantage of scientific libraries (which was useful for what I was building), while Rails was a bit more web dev focused. Rails does seem to have fallen out of favor over the last decade, while Django enjoyed a more steady level of popularity. I guess Python is a more popular language.

I don't think Rails is any less favoured than Django - the hype moved on from back end oriented web frameworks in general though.

Rails had a higher level of initial hype though, so maybe more of that moved on to other things leaving it closer to Django that had a slower decline.

Both projects are solid mature choices though - the downside of that might be attracting enough new/younger devs. Choice comes down more to Ruby vs Python depending on which one your team knows better or if you need other libraries from that language.

Re: Django 5.0

#165

Django made me fall in love with programming 13 years ago, and since then it has always had a special place in my heart. I’m revisiting a business idea I was working on for a couple years, before I sought and found employment in the industry (where I used Java for a couple years, then Elixir for a couple more). My project was built with Django and Django REST Framework, and Ember on the client-side. 6 years later, th…

Totally agree, but is Ember truly the most stable? This is pretty much my only criteria for JS at this point.

Fwiw trying to get an old ember app running was an absolute nightmare. On top of that it is way too heavy for my liking. Pretty much polar opposite of jquery.

Re: Django 5.0

#166

Earlier quoted context omitted.

Because they know, or want to know Python

Thank you, mister, but I mean from a techy point of view.

I only know laravel from skimming the docs, but I got the impression that there was not enough difference between it and Django to justify switching to a language you don't know,going either way.

That said... Does Laravel have something like Django's admin view?

Re: Django 5.0

#167
post #21
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?

Still Django unless you're only building a simple API.

Why not a complex API?

Re: Django 5.0

#168

Django made me fall in love with programming 13 years ago, and since then it has always had a special place in my heart. I’m revisiting a business idea I was working on for a couple years, before I sought and found employment in the industry (where I used Java for a couple years, then Elixir for a couple more). My project was built with Django and Django REST Framework, and Ember on the client-side. 6 years later, th…

> 6 years later, the Django side needed minimal changes and is up and running (I jumped all the way from 1.11 to 5.0 beta). I've been using Django since before 1.0, and the upgrade story has been nothing short of fantastic for something that's been around this long. But still, YMMV! Depending on how ancient a project you run into, it definitely can be a major pain, even with the original authors' best intentions. For…

<3 South

Re: Django 5.0

#169

Earlier quoted context omitted.

An approach I've done in the past for projects that are publicly API-based: Django handles the database migrations and user accounts/models/etc - and you get the useful admin to boot, which is just incredible if you ever need to open up the data layer to someone else. Then just write the API interface in Go/Rust/your language of choice. It decouples the DB modeling from the API layer, but in practice... I've just not…

It's not a bad idea, but the tradeoff is usually you'll have to define your models twice. For whatever reason, that tends to happen anyway, so not that big a drawback in practice.

Eh, in my case I prefer writing raw SQL for the API side of things - it's more apparent what's going on in code that I actually tend to wind up debugging down the road. As a result I don't really feel like I'm writing models twice - I model then code, then just read it directly, if that makes sense.

You are ultimately still right, I think - just a personal nuance I guess.

Re: Django 5.0

#170

I like Django rest framework a lot. It was really easy to make something with react and call Django directly however the templating engine is also great. It’s so strange people still use rails

> It’s so strange people still use rails Why? What makes Django better? (Genuinely curious.)

Rails is ruby… so that’s one thing

Rails is much harder to containerize

Rails structure is extremely messy and you have to learn how to do it the rails way. Python in general is easier to hire for and is just better

Post reply on HN