Live data from Hacker News

The Decline of Django

david-dahan.com

21–30 of 173 posts

Re: The Decline of Django

#21

Eh a lot of these seems like strengths of Django. Rails chasing the SPA dragon has been a source of endless pain.

Could you elaborate? After a ~10 years hiatus I revisited Rails last year and whipped up a CRUD app with auth in no time. No SPA in sight.

This was always Rails' strength from day one. The problems came when you tried to do anything that didn't fit into the guardrails laid down by RoR.

Re: The Decline of Django

#22

Earlier quoted context omitted.

Could you elaborate? After a ~10 years hiatus I revisited Rails last year and whipped up a CRUD app with auth in no time. No SPA in sight.

They've been mucking with the asset pipeline every single version and their forray into webpacker has been a disaster. Turbolinks and ActionCable have been attempts to compete with SPAs while still being SSR but both are just glitchy and a source of endless Heizenbugs. Thankfully Rails7 looks like they've restored sanity.

I must admit that zhe Turbolinks does glitchy stuff with the theme I ripped ( project is in the Ask-for-forgiveness stage ).

But you don't need to use Actioncable at all. But I do use it, to have my C/C++ clients communicate with the SaaS. Haven't experienced anything flaky there yet and I am glad a Websocket option was included.

Re: The Decline of Django

#24
Is instagram not hip anymore ? I’m using fastAPI after moving to flask for a personal project but all of these microfraneworks make me want Django for what is built in. Also , why not have backend frameworks in JavaScript? Everyone focuses on performance and disregards ergonomics.

> I mean, Instagram server is still a big Python codebase. It's Django at the core, I mean, it still runs through the Django request handling stack, and the middleware and views and URL routing, all of that is still Django. It looks familiar to any Django developer. Just very big, lots of views, lots of URLs, lots of code. There's a lot of, I mean, obviously, the ORM we don't use anymore, the admin is very much based on the ORM, so that's not in use anymore. And there's a lot of components, where Django provides kind of pluggable back ends, like sessions and authentication, and for all of that stuff, we've essentially rewritten the entire system. But we're actually still using the sort of Django API for those things, because it's pluggable. So I would call that a success story, I mean, in that we've been able to very smoothly migrate away from the components that that no longer worked at our scale, in many cases without even having to change the client code touching those subsystems because Django provides this ability to swap out the back end. So yeah, and you know, the Django core requests support that we still use, we're 100% async now, so already a few years ago, we kind of forked and modified a bunch of that to support async, or concurrent handling of multiple requests using async IO. So there have been some changes.

Re: The Decline of Django

#25
I can't comment on every use case, but I've recently been using htmx[1] with Django templates to provide sort-of async behaviour. For me it's the best of both worlds; I can specify my template and view as though it's a normal page load, and then use some hx- attributes to make it async.

1. https://www.mattlayman.com/blog/2021/how-to-htmx-django/

Re: The Decline of Django

#27
It might just be me but I really wish 95% web apps/sites didn't try to be single page apps. They have obscure failure modes, they're harder to QA, they require huge amounts of bandwidth and they're expensive to build.

Django's postback model might not be a model of what front end developers want to use for their backend, but it's definitely a model of how I like my frontends to behave - sparse and minimalist with a limited number of possible behaviors.

Re: The Decline of Django

#28
post #20

What’s better?

Rails. Switched from Django two years ago and never looked back. Having worked with both, Rails is more polished and pleasant to work with. Side note: if you're building a business and already know Python/Django, stick with them!

I swear I saw an article on here a few months ago about the decline of Rails

Re: The Decline of Django

#30
post #15

Earlier quoted context omitted.

Flask? Maybe FastAPI.

I second FastAPI! In my mind it's, "Flask, but better." The killer feature in my mind is that it leverages type hinting and dataclasses, using Pydantic, to take away a lot of the grindyy, boilerplate parts of writing an API, like type checking, dependency injection, generating good error messages, generating API documentation, ... Even when I'm not using FastAPI now, I use Pydantic everywhere. Types in Python, while…

Pydantic's BaseSettings has cured my configuration-DSL itch. You can type in (typed) defaults in Python and have them overidden by env vars.
Post reply on HN