Python小推车python学习

Python学习打call第四十四天:Web开发

2019-03-20  本文已影响3人  暖A暖

1.什么是WSGI?

2.服务器与应用程序直接的关系

3.WSGI中间件

“中间件”组件的功能有:

4.支持WSGI规范的Web应用框架

BlueBream
bobo
Bottle
CherryPy
Django
Flask
Google App Engine's webapp2
Gunicorn
prestans
Pylons
Pyramid
restlite
Tornado
Trac
TurboGears
Uliweb
web.py
web2py
weblayer
Werkzeug

5.什么是uwsgi

6.什么是uWSGI服务器

1.png
2.png

7.web开发入门

from wsgiref.simple_server import make_server

def wsgi_application(environ, start_response):
    status = '200 OK'
    headers = [('Content-Type', 'text/html;charset=utf-8')]
    start_response(status, headers)
    html_template = '<h1> Hello World <h1>'.encode()
    return [html_template, ]
if __name__ == '__main__':
    HOST = '127.0.0.1'
    PORT = 9000
    server = make_server(HOST, PORT, wsgi_application)
    server.serve_forever()
上一篇 下一篇

猜你喜欢

热点阅读