Introduction mounting frame web flask i.e.

pip3 install flask

About werkzeug

 

Werkzeug WSGI is a tool kit, he can serve as a low-level libraries Web framework. Here a little talk about, werkzeug not a web server, nor is it a web framework, but rather a tool kit, the official said WSGI is a toolkit that can be used as a low-level libraries Web framework, because it encapsulates a lot better Web what framework, such as Request, Response, etc.

Code Example:

from werkzeug.wrappers import Request, Response

@Request.application
def hello(request):
    return Response('Hello World!')

if __name__ == '__main__':
    from werkzeug.serving import run_simple
    run_simple('localhost', 4000, hello)

The python web framework:

  a: socket server b: routing and forwarding c: template rendering

  Django: a: use someone else's b, c write their own

  Flask: a: b with the others to write their own, c: with the others: jinja2

  Tornado: a, b, c are to write their own

  Sanic: After only support 3.5, does not support windows

  Django framework is a framework for synchronous or asynchronous frame? -Synchronize

  wsgi is a protocol specification that describes how to interact with the web server web application, how web application processing request .cgi: Common Gateway Interface

  
  -uwsgi, wsgiref which are both Django servers meet wgsi agreement, the project on uwsgi online use, wsgiref in the development environment using the
  web server Tomcat -Java in, Jboss

   web servers behind a web framework is callable objects, web server (Django, Java, PHP, etc. have their own web server) will call the web framework,

Guess you like

Origin www.cnblogs.com/Hale-wang/p/11202957.html