[mod_python] using publisher as a virtual dir with apache2/mp3

Marc O. Sandlus modpython at sandlus.de
Fri Mar 26 03:58:03 EST 2004


Hello list,

under apache1/modpython2 I used mod_python.publisher to serve python
functions of a file called "dir.py" as the contents of a "virtual" dir,
like so:

httpd.conf:

| DocumentRoot /some/path/dir.py

and dir.py was something like:

|def file1(req):
|  return "Hello World"

Requesting http://www.mydomain.com/file1 would return "Hello world".

How can the same be achieved under
Apache/2.0.48 (Debian GNU/Linux) mod_python/3.0.4 Python/2.3.3?

The problem is that under apache2, DocumentRoot needs to be a physical
directory which "dir.py" is obviously not.

Well, I could hack some RewriteRules, but is there a more elegant way to
do this?

Thanks for any help.

--Marc




More information about the Mod_python mailing list