pip3 install flask
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,