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?
Django 5.0
161–170 of 237 posts
Re: Django 5.0
#162What'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…
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
#163My 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.
Re: Django 5.0
#164Earlier 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.
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
#165Django 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.
Re: Django 5.0
#166Earlier quoted context omitted.
Because they know, or want to know Python
Thank you, mister, but I mean from a techy point of view.
That said... Does Laravel have something like Django's admin view?
Re: Django 5.0
#167What'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.
Re: Django 5.0
#168Django 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…
Re: Django 5.0
#169Earlier 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.
You are ultimately still right, I think - just a personal nuance I guess.
Re: Django 5.0
#170I 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 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