[mod_python] Getting Advx to run with mod_python

Graham Dumpleton grahamd at dscpl.com.au
Mon Jun 13 02:40:24 EDT 2005


On 13/06/2005, at 4:27 PM, Kahlil Johnson wrote:

> Hi, thanks I solve the problem however it triggers some doubts. From
> the doc what I got is that I set up a handler per page? is that true?
> I mean I set up the mptest.py and get a index.py printing the hello
> world. However as I advanced in the documentation it seems I need to
> set each hanlder per page.
>
> Is that true, or I am just missunderstanding it?

There is the base mod_python system and then there is 
mod_python.publisher
which builds on top of the base system.

When you use the base mod_python system, ie.,

   AddHandler python-program .py
   PythonHandler mptest

all requests under that directory with a ".py" extension are routed 
through
through the "mptest.py" handler file.

When you use publisher, ie.,

   AddHandler python-program .py
   PythonHandler mod_python.publisher

it is overlaying a dispatch mechanism on top of the directory. That is, 
the
mod_python.publisher system allows you to put published methods in 
multiple
files in the directory with each distinct function having a unique URL.
A function will only be called when its corresponding URL is used.

In the base system, it didn't really matter what the URL path contained 
as
long as it had a ".py" extension.

Thus, they are two distinct things and you need to be clear which one 
you
are talking about.

If you don't have PythonHandler set to either of the above values then 
you are
likely using yet another system on top of mod_python which will likely 
behave
in different ways again.

Graham

> On 6/13/05, Graham Dumpleton <grahamd at dscpl.com.au> wrote:
>>
>> On 11/06/2005, at 12:49 AM, Kahlil Johnson wrote:
>>
>>> I am using Mandrake 10.1 and it has Advx server wiht the Apache 2.0 .
>>> One thing that I found myself lost is locating the files for the
>>> apache configuration. I tried to put up the mod_python but all I get
>>> is that the mime-type is not recognize and the browser ask to 
>>> download
>>> the .py.
>>>
>>> I wonder where can I get the AddType since the
>>> /etc/httpd/conf.d/httpd2.conf  dont includes the AddType in that 
>>> file.
>>>
>>> Also I might ahve messed up somewhere else since it worked once but
>>> since I move several things I no longer know if it will again.
>>
>> Using "AddType" in Apache to trigger mod_python isn't generally how
>> things are setup. You might want to review the installation
>> documentation
>> for mod_python and start over with its test example. An alternate set
>> of instructions for getting a first test example in mod_python working
>> can be found at:
>>
>>   http://www.dscpl.com.au/projects/vampire/articles/modpython-001.html
>>
>> It describes some of the problems that can arise and where to look to
>> solve what is happening, including the common problem of why browsers
>> want to save the response to a file.
>>
>> Graham
>>
>>
>
>
> -- 
> Kahlil Johnson
> "Ya tengo GMAIL!!"



More information about the Mod_python mailing list