普通英语的WSGI和CGI是什么? [英] What are WSGI and CGI in plain English?
问题描述
每次阅读WSGI或CGI时,我都会感到畏缩。我曾经尝试阅读过它,但没有任何东西卡住。
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 just pipe requests to a terminal and redirect the output?
推荐答案
WSGI在Web服务器启动时运行Python解释器,作为Web服务器进程的一部分(嵌入式模式)或作为单独的进程(守护程序模式),并将脚本加载到其中。每个请求都会在脚本中调用一个特定的函数,并将请求环境作为参数传递给该函数。
WSGI runs the Python interpreter on web server start, either as part of the web server process (embedded mode) or as a separate process (daemon mode), and loads the script into it. Each request results in a specific function in the script being called, with the request environment passed as arguments to the function.
CGI将脚本作为每个请求的单独进程运行,并且使用环境变量,stdin和stdout与它通信。
CGI runs the script as a separate process each request and uses environment variables, stdin, and stdout to "communicate" with it.
这篇关于普通英语的WSGI和CGI是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!