[mod_python] Good example site with py, psp, and structure

durumdara durumdara at gmail.com
Wed Sep 20 06:32:23 EDT 2006


Hi !

I want to understand the modpy technics, to I create good structure for 
my new modpy site. An example needed.

I used PHP, Zope, CGI before this project.

If I understand it good, I can specify one handler script for one directory.
Anywhere, where I specify a handler, the handler script working for all 
.py (both for existing and not existing).
So if I need a centralized web application, I need to import a shared 
module that helps me to start and finish to handle the process 
(example:  pre - collect the important informations, make global 
variables, open the db connections, open the session datas; post - save 
the session if need, close the db connection, drop the content if we 
have redirection, etc.). I thinking good ?

1.)
But I need to protect some area in the htdocs (restricted area). How to 
I force it ? (auth module ?). I need to define to every dir I used 
(httpd.conf) ?

2.)
In Zope the header/footer objects used for handle the pre/post actions, 
and the zpts/scripts used for make the content of the page.
Is better to I use psp-s that call pre/post scripts, or is better if I 
use py scripts, and they are get psp-s I need ?

3.)
How to avoid to user type any .py to browser's address textbox, and get 
same result that handler present ?
Example: I use main.py for handle requests. The address is: 
www.foo.hu/main.py.
The user can type www.foo.hu/sux.py, and get same result !

4.)
How to prevent the .py extension showing in the browser ?
To I see (can type):
www.foo.hu/
or
www.foo.hu/index
not
www.foo.hu/index.py.
I want to protect my site - if anyone see it, he/she don't know, what 
engine I used.


Thanks for your answers:
dd







More information about the Mod_python mailing list