[英]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.