How Python is used as a back-end in web dev ? | Sololearn: Learn to code for FREE!

+1

How Python is used as a back-end in web dev ?

Good morning ducks, As we know, Python is a back end programming language, but how we merge HTML/CSS/JS and Python to make a website ? by Python front end modules ? or frameworks or what ?

1/30/2021 9:03:39 AM

Agt Reda

11 Answers

New Answer

+3

Python works in server, when web page requesting a server. There are 2 web development frameworks for Python. 1. Django https://www.djangoproject.com/start/ 2. Flask https://flask.palletsprojects.com/en/1.1.x/

+2

by sending text (html) response on server side to client (http) requests. usually, templates are used, where you could "merge" python code with html stuff, but all the python is interpreted at server side, and client only receive html (without any python code)...

+1

There are more than two web frameworks for python... there are a lot available: https://wiki.python.org/moin/WebFrameworks

0

visph i tough you need css and js too?

0

yes, when I said html, i thought "html bundle" (wich implies css and/or js if needed, as well as pictures, svg, or any other linked files)

0

Oh okay. Thanks for the answer!

0

visph Didin’t understand you, is there a video that explains that please ?

0

basics (templating not covered) of bottle (a python http micro framework): https://youtu.be/g_9nsFJS_pk template basics (in bottle): https://youtu.be/kDJFjC3Fjxc

0

visph But in which server ? it operates on cloud or database or what

0

Any server: it could be your own PC, your phone or obviously cloud... database is another question ^^

-1

We join a Python backend to a HTML/CSS/JS front end with JSON formatting. In an oversimplified nutshell; the Python back end receives JSON encoded messages from the client, decodes them, performs the work, encodes the appropriate JSON response, and sends it to the client for decoding and execution.