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:
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.
Code: https://github.com/Flowsnow/web_framework
See every commit.
reference
Recommended Posts