Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I am curious as to how python is connected to websites [closed]

I am a new programmer and I saw that Google is written in python. I know that HTML, CSS, and JS are used to make websites, so how is python "linked" to this. This is probably a very basic question but I am new to all this.

like image 843
Elliott Weiss Avatar asked Oct 14 '22 22:10

Elliott Weiss


People also ask

Do I need HTML and CSS for Python?

If you're interested in web development with Python, then knowing HTML and CSS will help you understand web frameworks like Django and Flask better. But even if you're just getting started with Python, HTML and CSS can enable you to create small websites to impress your friends.

Are Python and HTML compatible?

You can use python in your HTML code. You don't need to know javascript. PyScript is not just HTML only, it is more powerful, because of the rich and accessible ecosystem of Python libraries.


2 Answers

So your code in browser is called front-end (FE). Sometimes it's all you need. However, sometimes you need to store some data on the server and/or retrieve it from there. That is where back-end (BE) comes into play.

BE is basically an app on some computer (maybe a server, maybe a Raspberry Pi, anything really) that listens to requests from the network. Let's say your code needs some data from the server. Your code on the front end makes an AJAX request to the network address of this server on some specific port. The BE, which may be written in Python, or any other language, receives the request and does something with it.

It can fetch data from the DB or anything really. Then it send a response to your FE back, sending some data, or confirmation that everything was done successfully, or an error if something went wrong.

like image 58
IvanD Avatar answered Oct 18 '22 22:10

IvanD


Python is used for backend development. Backend is the part of your website that runs on your server, not browser. Backend is used for authentication and communicating with database and many more. There are some popular frameworks in python like django and flask.

like image 1
Shashoto Nur Avatar answered Oct 18 '22 22:10

Shashoto Nur