简体   繁体   English

与mod_wsgi相比,mod_python如何工作?

[英]Compared to mod_wsgi, how does mod_python “work”?

It seems most of the blog posts the web relating to mod_python & mod_wsgi concentrate on telling me how mod_wsgi is better and what a WSGI application looks like. 似乎大多数与mod_python和mod_wsgi有关的Web博客都致力于告诉我mod_wsgi更好,以及WSGI应用程序的外观。 This is fine, but what I'd really want to know -- to have complete knowledge of the subject -- is: 很好,但是我真正想知道的-要完全了解该主题-是:

How do they differ in running a script? 它们在运行脚本方面有何不同?

With CGI the server simply sets up the environment and runs a simple .py. 使用CGI,服务器只需设置环境并运行一个简单的.py。 WSGI wraps the application in an object, but the concept is still pretty much the same: run a .py file. WSGI将应用程序包装在一个对象中,但是概念仍然几乎相同:运行.py文件。

How does mod_python do it? mod_python是如何做到的?

I'm also really interested in learning how anything mod_ works, so, really, feel free to point me to anything interesting on the subject. 我也很想学习mod_的工作原理,因此,确实可以随时向我指出有关该主题的任何有趣信息。

Thanks! 谢谢!

You could start by reading: 您可以先阅读以下内容:

http://blog.dscpl.com.au/2009/03/python-interpreter-is-not-created-for.html http://blog.dscpl.com.au/2009/03/python-interpreter-is-not-created-for.html

The basic principle of when/how sub interpreters are created and used is the same in mod_wsgi as well. 何时/如何创建和使用子解释器的基本原理在mod_wsgi中也相同。

The question is why you would want to use mod_python as a basis for learning how it works as mod_python is no longer being developed and has been moved to the attic by the Apache software foundation. 问题是,为什么要使用mod_python作为学习其工作原理的基础,因为mod_python不再开发,并且已由Apache软件基金会转移到阁楼。 The mod_wsgi module also fixes various things mod_python gets wrong with thread handling if your intention is to go down to that level. 如果您的意图是降低到该级别,则mod_wsgi模块还修复了mod_python在线程处理方面出错的各种问题。

See the official mod_python documentation, namely: 请参阅官方的mod_python文档,即:

In practice, please note that there usually is no need to run Apache at all when working with python and web as there are many, many ways of serving the pages from python directly 实际上,请注意,在使用python和web时, 通常根本不需要运行Apache,因为有很多直接从python服务页面的方法

Standard library: 标准库:

External web servers: 外部Web服务器:

External Web frameworks: 外部Web框架:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从mod_python转换为mod_wsgi - Converting from mod_python to mod_wsgi mod_wsgi,mod_python还是只是cgi? - mod_wsgi, mod_python, or just cgi? 如何使用mod_wsgi实现mod_python风格的authenhandler / authzhandler? - How do I implement a mod_python style authenhandler/authzhandler using mod_wsgi? 子进程中的python unicode在控制台和mod_wsgi中无法正常工作 - python unicode in subprocess does not work same in console and in mod_wsgi Python + mod_wsgi / mod_python + Apache +用户的public_html - Python + mod_wsgi/mod_python + Apache + user's public_html 在同一Apache上一起使用基于Django的mod_wsgi和基于原始python的mod_python - using django based mod_wsgi and raw python based mod_python together on same apache 如果我在mod_python上有一些网页,在mod_wsgi上有一些网页,则保持用户身份验证 - maintaining user authentication if i have some web pages on mod_python and some on mod_wsgi Apache2:mod_wsgi或mod_python,哪个更好? - Apache2: mod_wsgi or mod_python, which one is better? 使用Comet / Orbited on Apache构建Django应用,使用mod_wsgi还是mod_python? - Building Django app using Comet/Orbited on Apache, use mod_wsgi or mod_python? mod_cgi,mod_fastcgi,mod_scgi,mod_wsgi,mod_python,FLUP。 我不知道还有多少。 什么是mod_php等价物? - mod_cgi , mod_fastcgi, mod_scgi , mod_wsgi, mod_python, FLUP. I don't know how many more. what is mod_php equivalent?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM