Live data from Hacker News

Is creating a Django backed reactjs (like nextjs but use django) a bad idea?

news.ycombinator.com

1–10 of 19 posts

Is creating a Django backed reactjs (like nextjs but use django) a bad idea?

#1
Hi folks, I am a frontend software engineer (reactjs, nextjs) and have been working on python for AI related stuff for quite a few years. I am wondering if creating something like nextjs but use Django as backend could be a bad/terrible idea or a good idea. What do you think? Thanks.

Here are the reasons behind this idea:

1. React (Nextjs) is wonderful for frontend while pythong works perfect for machine learning (at backend).

2. To demo or dev machine learning or AI related stuff we need some easy to start front-end framework. I have tried gradio but still wish the frontend could be replaced by reactjs.

3. Yes it's possible to create reactjs + Django app but think about reactjs + nodejs if comparing with nextjs.

What do you think?

Re: Is creating a Django backed reactjs (like nextjs but use django) a bad idea?

#6
I personally don't find NextJS appealing at all. It's so over the top, felt like it was adding complexity for the sake of it. Maybe it's a "skill issue".

Ultimately this all boils down to 2 things:

* your/your team's proficiency in the tech

* using the right tool for the job

I am not sure if you're trying to replicate some specific NextJS feature or if you're just asking what tech to use for your backend? If it's the latter, Django/Flask/FastAPI will do just fine. More than fine. It's boring, but it works.

My go to would be a simple REST API backend + ReactJS on the frontend. If you want to start mixing server side generation then there is a way forward but it depends on the nature of your app.

Start simple. Keep it boring.

Re: Is creating a Django backed reactjs (like nextjs but use django) a bad idea?

#7
I don't know what is the benefit of using NextJs over React when managing a backend in django. You wouldn't necessarily even need React, just plain old django ssr.

Django and Next are both very opiniated and can basically achieve the same results.

Point by point: "1. React (Nextjs) is wonderful for frontend while pythong works perfect for machine learning (at backend)."

-Nextjs is a fullstack framework. You can use python with lighter backends too, for example Flask or Starlette. What benefits would Next bring is you're planning to use django?

"2. To demo or dev machine learning or AI related stuff we need some easy to start front-end framework. I have tried gradio but still wish the frontend could be replaced by reactjs."

-If you have a good grasp of React, go with it. Nextjs however is a lot more complex. You could also work vanilla for the front.

"3. Yes it's possible to create reactjs + Django app but think about reactjs + nodejs if comparing with nextjs."

-If you're talking about plain React, then whatever backend you suits your need (if ML-things, probably a Python / Go based one) will do. If you're planning to use Nextjs, it would make more sense to do as much as possible in Nextjs and host a lighter api / backend / lambdas for ai-stuff. Using express means using JS too in the backend. This isn't an advantage necessarily – HTTP doesn't care about the language of the backend.

Re: Is creating a Django backed reactjs (like nextjs but use django) a bad idea?

#8
Honestly, this doesn’t sound like a bad idea at all! Next.js is great for frontend, and Django is super powerful for backend, especially for AI/ML stuff. The main challenge would be making Django feel as seamless as Node.js does with Next.js, especially with API routes and SSR. But if you can figure out a good DX, it could actually be really useful for AI devs who want a smoother frontend experience without dealing with Node. Would love to see a proof of concept!

Re: Is creating a Django backed reactjs (like nextjs but use django) a bad idea?

#9
post #7

I don't know what is the benefit of using NextJs over React when managing a backend in django. You wouldn't necessarily even need React, just plain old django ssr. Django and Next are both very opiniated and can basically achieve the same results. Point by point: "1. React (Nextjs) is wonderful for frontend while pythong works perfect for machine learning (at backend)." -Nextjs is a fullstack framework. You can use p…

Thanks for feedback! Yes I have been using plain old django :) as well as reactjs/nextjs in enterprise product for a while. I have also used reactjs + django (as a pure api backend) but the experience is not as smooth as nextjs. However, when dev AI/ML application in terms of DX, python (django) is definitely way better than javascript based backend (nextjs or nodejs).

Re: Is creating a Django backed reactjs (like nextjs but use django) a bad idea?

#10

I personally don't find NextJS appealing at all. It's so over the top, felt like it was adding complexity for the sake of it. Maybe it's a "skill issue". Ultimately this all boils down to 2 things: * your/your team's proficiency in the tech * using the right tool for the job I am not sure if you're trying to replicate some specific NextJS feature or if you're just asking what tech to use for your backend? If it's the…

Thanks for feedback! I like "Start simple, keep it boring" LOL Yes, I am trying to replicate nextjs but using django instead for server side and still keep reactjs for client rendering part. I have been using reactjs + django from time to time. I am wondering reason that people switched from nodejs + reactjs to nextjs. What is the benefit for that?
Post reply on HN