[mod_python] ImportError issue

Reuben A Christie christie at knewco.com
Fri Dec 5 17:44:03 EST 2008


this is how my apache config looks like
<Directory /usr/local/apache/htdocs/linker_python >
        Options  ExecCGI -MultiViews FollowSymLinks
        AllowOverride All
        Order allow,deny
        allow from all
        AddHandler mod_python .py
        PythonHandler launch
        PythonDebug On
        AddType text/plain
</Directory>

and in the code i do following

req.send_http_header()
req.content_type = 'text/xml' (it does not matter what do i set content 
type, even if i change this to text/plain or text/html does not make any 
differece)
req.write("<response>hello world</response>")


Graham Dumpleton wrote:
> 2008/12/6 Reuben A Christie <christie at knewco.com>:
>   
>> In the python script itself, i set the content type to text/plain , I have
>> not set any AddType directive in apache config
>>     
>
> Please post code snippet showing how this is being done and what
> handler you are using? Ie., custom handler, mod_python.publisher etc.
>
> What AddHandler directives do you have set in Apache configuration?
>
> Have you setup any output filters in Apache, ie., AddOutputFilter* directives?
>
> Graham
>
>   
>> Graham Dumpleton wrote:
>>     
>>> 2008/12/5 Reuben A Christie <christie at knewco.com>:
>>>
>>>       
>>>> thanks alot graham. I was able to import the modules the way you showed.
>>>> its
>>>> little intriguing but I think I ll find a better way by combining them
>>>> into
>>>> one __init__.py  hopefully that will work
>>>> one more question, I keep seeing this warning message on apache log
>>>> [warn] Cannot get media type from 'mod_python'
>>>> its not causing any issue but I really don't understand why is it
>>>> appearing
>>>>
>>>>         
>>> What is the content type you are returning or have setup using AddType
>>> directives? It appears it may be malformed. The message is mod_mime
>>> complaining about it.
>>>
>>> Graham
>>>
>>>
>>>       
>>>> Graham Dumpleton wrote:
>>>>
>>>>         
>>>>> 2008/12/3 Reuben A Christie <christie at knewco.com>:
>>>>>
>>>>>
>>>>>           
>>>>>> Hi all, I am pretty novice user of mod_python. and there is an issue
>>>>>> that
>>>>>> I
>>>>>> am experiencing with mod_python scripts for past 2 days that I am not
>>>>>> able