Live data from Hacker News

Django 5.0

djangoproject.com

231–237 of 237 posts

Re: Django 5.0

#231

Earlier quoted context omitted.

REST Framework is frankly... flawed. Full of good ideas, but in practice, it leads to development hell unless you're very rigorous with it. FastAPI is the gold standard, which in the Django works means Django-Ninja. If you've been building individual React components and integrating them without going the SPA route, then while there are some upsides to that, you are doing a lot of the effort but not getting most of t…

The lesson learnt is that React is an "all or nothing" type thing. You'll notice "SPA" isn't mentioned at all on the React website, but there's lots of mentions of building components. There are lots of comments around places like HN of people learning the same lesson as me. We never scoped replacing our entire UI with React and entire backend with JSON API because it seemed like there was a smooth upgrade path, but…

React isn’t all or nothing… you can upgrade bit by bit, extremely incrementally. But if you’re mix and matching frameworks and paradigms together then yes expect to not get the full value.

It’s like judging Django when only using it for its utils package and saying it’s “all or nothing”. Django isn’t really all or nothing either but you won’t get its full value if you just use it to supplement Wordpress for a single endpoint or something.

Re: Django 5.0

#232

Earlier quoted context omitted.

If you want a similar experience in JS check out Joystick [1]. It's being built to mimic the indefinitely stable design of stuff like Django and Rails. [1] https://github.com/cheatcode/joystick

Which is just yet another js framework which might disappear next month. That's the problem.

You have no reason to believe me but short of my own death halting development, no. I'm not doing it for fashion/clout/money/boredom. I'm doing it because I refuse to work with the mental illness that the JavaScript ecosystem has become.

Re: Django 5.0

#233
post #111

Earlier quoted context omitted.

No thanks, I prefer to drop React and use django + htmx for ajax.

Hey, if you're happy writing html using not-quite-jinja templates that are completely impossible to test, auto-format, or even sometimes syntax highlight... what can I say, power to you. You go, buddy.

You can integration test, you can use the debug plugin for htmx, you can format them with vs code extensions, and there is a highlighter available, though it’s not that important seeing as how each attribute is pretty simple.

Re: Django 5.0

#234

Earlier quoted context omitted.

I’d also add that if you use Typescript with an OpenAPI client generator ( https://github.com/ferdikoomen/openapi-typescript-codegen ) it can immensely alleviate some of the biggest pain points of seperate backend and front-end. It always used to be a major pain in the ass with the amount of overhead an API change would incur - updating documentation, postman, constant communication between backend and front-end devs…

> constant communication between backend and front-end devs Curious, are you doing anything in your code-generation workflow to solve this specific pain point?

I should have been more specific, the codegen alleviates a large portion of back and forth that would have otherwise been spent asking the backend devs things like “why isn’t this working”, or “what has changed”. There is still a lot of communication involved, but it relates more to the business objectives and less annoying fiddly things. For my current project the backend devs are using a cumbersome enterprise stack - the one saving grace for me being that they have swagger (OpenAPI) docs. As a front-end dev the codegen really helps to shield me from a lot of implementation specific backend stuff, as if the interface changes I am going to be informed about it from the Typescript compiler. Also one really great feature is that specific values for validation, such a min/max character length are also exposed and generated with the codegen so that is also another bunch of variables that I can worry less about when I implement clientside validation.

I’d really recommend taking a look at the tool I linked. I see a bunch of end-to-end Typesafety tools mentioned like GraphQL, Protocol Buffers, etc, but they seem overly prescriptive to me, and most of the time you are gonna be working some basic REST service and an OpenApi/Swagger doc is the best you are going to get from the backend devs.

Re: Django 5.0

#235
post #183
post #52

Earlier quoted context omitted.

I absolutely agree. Recently I had to work on a complex client app, and I could simply not believe the amount of trouble you have to go through when you want to increment the version number of things like React, MUI, webpack, TS by.. one!

> want to increment the version number of things like React, MUI, webpack, TS by.. one! To be fair, in semver that means a breaking change of some sort.

It does, however it also does for Django.

Breaking changes can vary between 'these one or two things out of thousands must be changed' and 'yeah we did a rewrite and its a new library but we kept the name as its pretty well known'.

Re: Django 5.0

#236

Earlier quoted context omitted.

What do people like torturing themselves by duplicating code. Wouldn't it be easier to just use node all the way. Writing hundreds of lines of JS to display a Table list, instead of HTML sprinkled with some JS

A whole stack rewrite is not always (in fact very rarely) a good idea. The backend often drives a lot of logic; in a big rewrite, the less you rewrite the more likely you are to be successful. Too many big refactors fail because they aren’t done in value-adding steps. Also your second paragraph isn’t in line with your first … in react you don’t write “hundreds of lines of js” for a table. You write the html as js (js…

I've seen, routing boilerplate, js to make the api requests, js to modify state(redux), unit tests, interfaces, until you get to the actual table.

Re: Django 5.0

#237
post #77

Earlier quoted context omitted.

Django and django-unicorn is really nice. It feels like meteorjs but for Django, extremely productive. I've been working with the creator closely and he's awesome.

django-unicorn is really impressive! So glad to see people pushing back on all the gunk inherent in webdev still.

it's neat! Not 1.0 yet but it's coming along. I find it more productive than react etc.
Post reply on HN