Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Sure. And I think what makes Rails and Django shine is they have sound default answers.

I’ve yet to see anything in Node that feels like a stable 1:1 replacement. Next.js is excellent, but you still need to sort out a lot of pieces on your own.



I'm working on two inherited Django web apps right now, for the same customer. I wish Django has a default project structure like Rails. It doesn't. The only common ground between the two apps is that they are written in Python, use the same ORM and templating engine. One is a spaghetti monster of a zillion of apps that depend on each other (so the separation in apps is useless) and the database is totally opaque to inspection. The other app luckily tucked nearly everything inside a single app so its saner to navigate and we can query the database with SQL tools.

The point is that Django lacks a sane default for project structure and it costs time/money to people using it.


If anyone else is feeling this pain please consider using this template https://cookiecutter-django.readthedocs.io/en/latest/


That's not accurate. Djano encourages, but does not mandate, a particular structure. Incompetent developers will always find a way to subvert whatever sensible defaults are at hand, which is the case you are faced with.


I have not had as much of a problem with structuring django projects. I agree there could be better documentation recommending best practices.

There is a very good talk from Dan Palmer from Djangocon 2021 called "Scaling Django to 500 apps" that gives helpful advice for project layout in a django app that may only have a few or several apps:

https://2021.djangocon.us/talks/scaling-django-to-500-apps/

That said, if we're going to dig on Django, it lacks typing, core-based API patterns and any embrace of modern front end. There are positive signals though, releases are coming faster and there is some real talent on the tech board right now.

I do think django and python in general are in a defensive position to hold the future of backend webdev compared to node / deno. However, there's still plenty of opportunity to compete for developers.


I've never used Next.js so I decided to take a look. The first step in their Getting Started guide illustrates this pretty well...

  npx create-next-app@latest
  # or
  yarn create next-app
I would choose npx while my friend would choose yarn but there isn't a default or even an indication of why you might like either choice. We kinda just assume everyone already has a preference for npx or yarn.

This is really a Node or JavaScript problem and not an Next.js problem. Not that I have any idea how you might solve it. This is also just a single example and we tend to have these decisions at a lot of steps along the way.


As others have pointed in this thread, there's NestJS, Sails.js and AdonisJS, which are closer to Rails than Express or Next.js. And there's Meteor too, like the sibling post mentioned.

But to be fair 99% of JS backends I see are using Express (or AWS Lambda). Considering there's lots of choices I wonder if the problem is the fact the community never focused on a single solution. I wonder if a Merb/Rails-style merge between some of them would help that.


Love using NestJS. It's true that most places are stuck using express for whatever reason so you have to be a bit ahead of the pack.


RedwoodJS may be something you want to check out.

https://redwoodjs.com/


Yes, RedwoodJS seems like Rails for JavaScript.

Recently I’ve also been impressed with Remix that was mentioned in the article. It seems to have solved the client server code duplication problem while still offering the benefits of both.


Without knowing if it's possible, I really want to see a RedwoodJS w/ Remix proof-of-concept.


That would be awesome.


Agreed, I think it is the explicit goal of the project to get that same batteries included feeling of Django/Rails


> I’ve yet to see anything in Node that feels like a stable 1:1 replacement

I’m not sure why there should be; for people who are happy with “good enough” default choices for a web app, Rails exists and makes the choice “Ruby” when it comes to language.


Definitely some exciting stuff like Redwood and Wasp working to solve these problems. I always loved what Meteor tried to do for this, though the JS ecosystem sort of evolved in a different direction.


Do most people use Django as a server-side framework (no frontend-JS or very minimal JS, may be jQuery)? Or, is it mostly used as an API to interact with the React/Angular/etc front-end framework? What I am trying to get at is do people still build POST-redirect-GET patterns and such for form submissions or they use Django in a more 'modern' way?


From my recent foray into modern Django world, most simple projects and MVP start out as server side like the official guide. Then, when people need some extra frontend magic like React and/or SPA, it's pretty easy to insert into Django. You just include the bundled React/Vue app into a js script still included and served by the same Django route/view/template. Of course, it's also common to start transitioning to Django Rest Framework (DRF) as your API points.


You can use either or both... server-side comes out of the box, and is used by the getting started tutorial. API-based is also very common using django-rest-framework.

I'd say it is still a mix of both and both paths are well-supported and well-maintained.


Meteor comes to mind




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: