Why should I use WSGI?

后端 未结 6 1540
小蘑菇
小蘑菇 2021-02-05 07:34

Been using mod_python for a while, I read more and more articles about how good WSGI is, without really understanding why.

So why should I switch to it? What are the ben

6条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-05 07:52

    You shouldn't have to relearn much, since the difference from a developer perspective is just a small wrapper and some server configuration.

    From a deployment perspective, the difference is that your python code lives in a separate process from the web browser, which means

    a) The python process can be running as another user than the web server. This can be valuable for security, if used right.

    b) The web server processes does not need to contain the python runtime. This can be a major boost for performance if the server runs a lot of "other" requests (static files, etc) and some heavy python requests.

提交回复
热议问题