On Thu, 15 Mar 2007 17:46:44 -0500
"Whil Hentzen (Pro*)" <[EMAIL PROTECTED]> wrote:
> What requirements are there, other than mod_python and some tweaks to
> httpd.conf, for Python to replace PHP as the language engine for a
> Web app?
That depends. :) The most basic setup all you need is mod_python and
tweak the httpd.conf.
> What are the differences, if any, running on a Windows box?
Have not done this.
> And how does it work? I've poked around a bit but haven't found a 30
> second 'this is what it does' tutorial. I'm looking for one of those
> explanations you'd get while riding up in an elevator with someone,
> on the order of "PHP is an Apache module that intercepts requests to
> the server.
Straight from mod python's website. "Mod_python is an Apache module
that embeds the Python interpreter within the server."
> You have a .php page on the server. In it is a mixture of
> PHP and HTML code. When a browser requests the page, the PHP module
> interprets PHP commands and functions on the page and returns static
> text as results of those commands and functions."
You can configure mod_python to run pretty much just like this.
There are other ways to configure it too. We do it a different way.
We created a Webmail client using mod_python. Every request to our
webmail's home directory goes through a python file called "index.py"
So index.py routes requests to the appropriate function. Here is
kinda of a half-assed example of our index.py. Would try to explain
better but gotta leave for a bit.
def index(req):
## Called by default. for example www.ourdomain.com/~webmail
return home(req)
def home(req, message=""):
return "html text for homepage"
def login(req, username, passwd):
## called by www.domain.com/~webmail/login?username=flozel&passwd=abc
## pipop is a class we created to handle email
pop = pipop.PiPop(username)
if pop.login(username,password):
ok = True
return mail_setup(req)
else:
return home(req, 'Username and Password not found!')
def mail_setup()
## blah blah
kc
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.