[mod_python] Problem in Configuring

Jason Stubbs jstubbs at work-at.co.jp
Mon Sep 12 21:04:00 EDT 2005


devansh mittal wrote:
> and i made a program,
> 
> from mod_python import apache
>       
>        def handler(req):
>                req.content_type = 'text/plain'
>                req.send_http_header()
>                req.write('mptest.py\n')
>                return apache.OK
> 
> when i run this programe by using this command,
> 
> python program_name.py
> 
> then it gives me this error.
> 
> ImportError: No module named _apache

 From the documentation on the apache module:

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.

--
Jason Stubbs


More information about the Mod_python mailing list