Writing web pages in python without any environment isn’t painless. Despite inconveniences you have access to Session, Cookies and Transactions fields.
You can distinguish between incoming addresses thanks to:
Simple page using just one function:
from mod_python import apache
def handler ( request ):
There’s a good manual concerning mod_python here: