What exactly is Werkzeug?

前端 未结 5 1053
[愿得一人]
[愿得一人] 2021-01-29 22:45

From the official documentation:

Werkzeug is a WSGI utility library for Python.

However, when I run my Flask web application, I noti

5条回答
  •  闹比i
    闹比i (楼主)
    2021-01-29 22:45

    No it isn't

    Werkzeug(WSGI library) is like a communicator between your python code and http nginx/apache server

    Here is the Complete use case of Werkzeug WSGI:

    WSGI has two sides: the "server" or "gateway" side (often a web server such as Apache or Nginx), and the "application" or "framework" side (the Python script itself). To process a WSGI request, the server side executes the application and provides environment information and a callback function to the application side. The application processes the request, returning the response to the server side using the callback function it was provided.

    Between the server and the application, there may be a WSGI middleware, which implements both sides of the API. The server receives a request from a client and forwards it to the middleware. After processing, it sends a request to the application. The application's response is forwarded by the middleware to the server and ultimately to the client. There may be multiple middlewares forming a stack of WSGI-compliant applications.

    Hope it helps

提交回复
热议问题