What are WSGI and CGI in plain English?

前端 未结 4 1925
孤城傲影
孤城傲影 2020-12-22 14:51

Every time I read either WSGI or CGI I cringe. I\'ve tried reading on it before but nothing really has stuck.

What is it really in plain English?

Does it j

4条回答
  •  Happy的楠姐
    2020-12-22 15:21

    Both CGI and WSGI define standard interfaces that programs can use to handle web requests. The CGI interface is at a lower level than WSGI, and involves the server setting up environment variables containing the data from the HTTP request, with the program returning something formatted pretty much like a bare HTTP server response.

    WSGI, on the other hand, is a Python-specific, slightly higher-level interface that allows programmers to write applications that are server-agnostic and which can be wrapped in other WSGI applications (middleware).

提交回复
热议问题