|
|
|
Is creating a Django backed reactjs (like nextjs but use django) a bad idea?
|
|
5 points
by zxu
496 days ago
|
|
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? |
|
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.