httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Howell <chow...@pyxisinnovation.com>
Subject Re: [users@httpd] Testing Python Mod
Date Tue, 04 Sep 2007 14:46:36 GMT
Brian Munroe wrote:
> On 8/31/07, Chris Howell <chowell@pyxisinnovation.com> wrote:
>
>   
>>  AddHandler python-program .py
>>  PythonHandler mptest
>>  PythonDebug On
>>
>>     
>
> Chris:
>
> I would suggest you use the Publisher mod_python handler, at least to
> get started.
>
> Here is a simple hello, world in mod_python.  I assume you fixed your
> other problem with mod_python from yesterday?  Let me guess, reinstall
> everything? :)
>
> In my httpd.conf file, in a global scope.
>
> LoadModule python_module modules/mod_python.so
> AddHandler mod_python .py
> PythonHandler mod_python.publisher
> PythonDebug On
>
> Then inside of my DocumentRoot (default is htdocs), I have a file
> called hello.py that looks like:
>
> def world(req):
> 	return "hello, world"
>
> Then finally, I access it via:
>
> http://localhost/hello.py/world
>
> which renders "hello, world" in plain text to the browser.
>
> -- brian
>
> PS.  Don't cross-post to lists, you are going to get flamed by the moderators!
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
>
> Brian:
     I made the modifications you suggested my httpd conf file now has 
this entry in it.
 
LoadModule python_module modules/mod_python.so

<Directory "C:/Program Files/Apache Software 
Foundation/Apache2.2/htdocs/Test">
   Order deny,allow
   Satisfy all
   AddHandler mod_python .py
   PythonHandler mod_python.publisher
   PythonDebug On
</Directory>


My test.py file looks like.

    def world(req):
       return "Hello World"       

When I try to access it like
http://localhost:9000/Test/test.py/world

I get a 404.

Any other ideas ?




Mime
View raw message