Py_Apache Vs. mod_python

jick78 at my-deja.com jick78 at my-deja.com
Mon Jul 10 16:47:15 EDT 2000


I'll just post to clear up some of the confusion around some
of the Apache+Python modules.

mod_snake in its most basic form allows you to load Python
modules into the Apache server to hook into the various
Apache phases (such as check_user_id, etc.)  There are
modules that come with mod_snake, that allow you to
accelerate CGI scripts via keeping an interp around
(py_Apache does this), and also one that allows you to
write very 'simple' modules similar to mod_perl or
mod_python.  There is also a module to perform embedded
Python processing within HTML via embPerl syntax.  I.e.:

[-import time-]
<H1> The date is [+time.ctime(time.time())+] </H1>

The current main differences between mod_snake and mod_python
are:

o mod_snake works in both Apache 1.3 and 2.0 series.  Mod_Python
  currently only runs in Apache 1.3.

o mod_python runs under Windows -- mod_snake does not.

o mod_snake allows Python written modules to create their own
  configuration directives, and gives the modules more power
  similar to that of C-style Apache modules (via per-dir configs,
  etc.)  mod_python only allows for mod_perl style callbacks.

There are more subtle differences, but we can leave those alone.

To check these out, you can check out:
modsnake.sourceforge.net
or
modpython.sourceforge.net

-- Jon





In article <8kai0a$7fm$1 at nnrp1.deja.com>,
  johnvert at my-deja.com wrote:
> In article <396863B7.875EA939 at stroeder.com>,
>   Michael =?iso-8859-1?Q?Str=C3=B6der?= <michael at stroeder.com> wrote:
> > Tim Roberts wrote:
> > >
> > > I'll say.  Am I correct in understanding that the basic purpose of
> > > "mod_snake" is to allow me to write other Apache modules in
Python,
> while
> > > PyApache is a module which lets me run Python CGI scripts without
> > > launching a separate interpreter,
> >
> > Yes. PyApache resets the Python interpreter everytime which leads to
> > reloading of the modules for every hit.
> >
> > With mod_python you can write Apache handlers but also wrap normal
> > CGI-BIN scripts without having to reload the modules for every hit.
> >
> > Ciao, Michael.
>
> Which one of these modules can you use to write embedded python code?
> I.e.
>
> foo.html.py:
> <html>
> <body>
> Looping through red, blue, green:
> <python>
> colors = ['red', 'blue', 'green']
> for color in colors:
>     print color
> </python>
> </body>
> </html>
>
> Thanks,
>  -- John
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list