Python Backend Infrastructure

WSGI: Web Server Gateway Interface

PEP 333 – Python Web Server Gateway Interface v1.0 | peps.python.org

WSGI is a simple and universal interface between web servers and web applications or web framework. 

What is a web server?

A web server is software or hardware or both. 

  • hardware - a web server here means a computer which has software web server and component files such as html, CSS, images, videos, JavaScript files. A webserver connects to the internet and support physical data interchange with other devices connected to web.
  • software - a web server includes parts that control how a web user accesses hosted file. A software webserver is an HTTP server and files that will be served to the users. (HTTP server + files)

What is HTTP server?

  • An HTTP server is software that understands web addresses and protocol that our browser uses to view webpages. We can access an HTTP server through the domain name of a website, and it delivers the content of the hosted website to the end user device.  

What is a web server? - Learn web development | MDN

What is a web application?

A web application is a software that is not required to installed in your device. Instead we can directly use them using our browser. It relies on three things

- webserver to handle the end user request and direct them to the right place

- application server: It processes the requested task and generate the needed response

- Database: Stores the data and give it to the application server as needed.

What is Web App - GeeksforGeeks

What is Gunicorn?

Gunicorn is a web server for python applications. It receives requests sent to the web server from a client and forward them onto python applications or web frameworks such as fastapi, flask, django. 

In our code, we need to create a function that will be gunicorn point to the application.

gunicorn is a python WSGI HTTP server used to serve python web applications such as fastapi, Django ,and flask. 

It is a pre-fork worker model WSGI server, which means it spawns multiple worker processes to handle multiple requests simultaneously, improving performance. 

Gunicorn - green unicorn 

What is gunicorn? - DEV Community 


gunicorn with fastapi:

Mastering Gunicorn and Uvicorn: The Right Way to Deploy FastAPI Applications | by iklobato | Medium

Comments

Popular posts from this blog

Git Basics

Linux Basics

Internet basics