The Python Application Programmer interface to Apache internals is contained in a module appropriately named apache, located inside the mod_python package. This module provides some important objects that map to Apache internal structures, as well as some useful functions, all documented below.
The apache module can only be imported by a script running under mod_python. This is because it depends on a built-in module _apache provided by mod_python. It is best imported like this:
from mod_python import apache
mod_python.apache module defines the following objects and functions. For a more in-depth look at Apache internals, see the Shambhala API Notes
APLOG_EMERG APLOG_ALERT APLOG_CRIT APLOG_ERR APLOG_WARNING APLOG_NOTICE APLOG_INFO APLOG_DEBUG APLOG_NOERRNO
server is a reference to a Request.server object. If server is not specified, then the error will be logged to the default error log, otherwise it will be written to the error log for the appropriate virtual server.
mp_table. See Section 4.3.1 for a description of a table object.