3

Do you know if there is a python equivalent of php's virtual() ?

My configuration is python, djanogo, mod_wsgi, apache

Trying to include a script that has only examples for php using the above include and also needs to be included in all website's pages.

Thanks

LE: I'm including a .cgi script

Mecca
  • 659
  • 1
  • 7
  • 17
  • 1
    Could you make a CURL request to localhost instead? – Spudley Jul 21 '11 at 09:47
  • Why you couldn't just include the files the common way (`include 'file.php';`)? – KingCrunch Jul 21 '11 at 09:54
  • @agf: He is looking for a python- _equivalent_ of _PHPs_ `virtual()`. I were curious, why he wants to use `virtual()` or something like `virtual()` at all, if one can use `include()`, or -- because he mentioned the cgi-script now -- (e.g.) `exec()`. `virtual()` is a) a Apache-only feature and b) fires an additional request. Without good reasons its just overhead. – KingCrunch Jul 21 '11 at 11:34

1 Answers1

0

The only reference to this I see is

http://www.modpython.org/pipermail/mod_python/2004-January/014834.html

Which states In theroy you can use the Apache 2.x chain handlers feature, where more than one content handler can process the request. I say in theroy because I've read about it, but never tried it =)

From the PHP Manual, virtual() is an Apache-specific function which is similar to <!--#include virtual...--> in mod_include. It performs an Apache sub-request . . . This function is only supported when PHP is installed as an Apache module.

Here is the link for info about Apache Filters, which is what is meant by "chain handling":

http://httpd.apache.org/docs/2.2/filter.html

The document should be able to be processed by mod_include after it's output from mod_wsgi (or before, if that's what you want).

agf
  • 171,228
  • 44
  • 289
  • 238