Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can we use python with react? [closed]

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

like image 397
Beebas Rijal Avatar asked Nov 26 '18 15:11

Beebas Rijal


2 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 https://realpython.com/ 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.

like image 150
Morgan Avatar answered Nov 11 '22 04:11

Morgan


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 : https://realpython.com/the-ultimate-flask-front-end/

like image 5
Fawzi Avatar answered Nov 11 '22 02:11

Fawzi