这样就可以了。 它提供客户端IP地址(远程主机)。
请注意,此代码在服务器端运行。
from mod_python import apache req.get_remote_host(apache.REMOTE_NOLOOKUP)