I have seen many people are using Nodejs with reactjs but I liked python and react so much that I wanted to know if I could python with react. If so could you please give me some links for learning that please
4 Answers
I have experience building web applications using React and Python Flask together, so perhaps I can help.
I do not know of a way to directly use Python on client-side web applications, but there are certainly plenty of ways to use Python on the backend. The most popular Python web frameworks are Flask and Django.
If so could you please give me some links for learning that please
YouTuber Corey Schafer has a great YouTube tutorial series on Flask, which I would wholeheartedly recommend.
Once you get more comfortable with web development in Python, I think the website has great tutorials for both specific questions (e.g. Token-Based Authentication in Flask) and more general tutorials.
If you go with Django, it has a great ORM built in for working with databases.
If you go with Flask, which is definitely more beginner friendly IMO, I would recommend Peewee ORM for working with relational databases unless you have more complicated use-cases, in which case SQLAlchemy is the de-facto standard.
Good luck learning!
Update
I just came across this cool Python library called Transcrypt that transpiles Python code into JavaScript, so it turns out you can write client-side code for the web in Python. Their website has some cool tutorials.
Yes. React is mostly agnostic of what's going on at the server-level. ie it does not care what backend you use.
Check this example :
React is backend-agnostic.
React manages the UI, which possibly interacts with some HTTP APIs regardless in what language they're made of.
What's important is that your API use some standard like REST, jsonapi or GraphQL so you can benefit a wide range of tools (documentation, tests...)
That said, if you want to make "server-side-rendered" react web apps, like Next.js does, or if you need WebSockets, you'll need NodeJS on the server-side too. Also, the ability to use the same code, tooling and ecosystem on the client and the server is useful for a developer.
I have been using this to build up react app with python. They have new libs 'dash' and dash component whose underlying is react.js.