Python implements a universal web framework

Overview#

Python WSGI specifies a standard interface between a web server and a Python web application or web framework, mainly to promote the portability of web applications on various web servers. Under the WSGI specification, various web servers and web frameworks can interact well. Because of the existence of WSGI, it has become easier to write a simple web framework in Python.

The core part of the web framework is the routing system. After the client's request is sent to the wsgi server, the web framework finds the corresponding handle method after multi-level routing according to the method and path in the request, and then obtains the response by calling the method to process the Request.

This time mainly depends on two libraries:

Hierarchy diagram#

The following is the hierarchical structure and data flow diagram of the entire process that the client sends a request to the WSGI server through the Web framework.

Web framework implementation#

Code: https://github.com/Flowsnow/web_framework

See every commit.

reference

Recommended Posts

Python implements a universal web framework
Python implements a guessing game
A complete guide to Python web development
Python implements a simple business card management system
Python web crawler (practice)
Python implements Super Mario
Python implements tic-tac-toe game
Python implements tic-tac-toe game
Python implements man-machine gobang
Web Scraping with Python
Python implements Tetris game
Python implements image stitching
Python implements minesweeper game
Python implements scanning tools
Python implements threshold regression
Python implements minesweeper games
Python implements FTP to upload files in a loop
Python implements electronic dictionary
Python implements guessing game
Python implements WeChat airplane game
Python implements word guessing game
Python implements parking management system
Python implements digital bomb game
Python implements TCP file transfer
Python numpy implements rolling case
OpenCV Python implements puzzle games
Python implements password strength verification
Python implements car management system
Python implements code block folding
Python implements panoramic image stitching
Python implements SMTP mail sending
Python implements multi-dimensional array sorting
How Python implements FTP function
Python implements mean-shift clustering algorithm
Python implements verification code recognition
Python implements gradient descent method
Python implements text version minesweeper
Python implements image stitching function
Python implements the brick-and-mortar game
What is the difference between a python script and a web page