[mod_python] How do you use mod_python?

Ognen Duzlevski oduzlevski at intechjanus.com
Wed Jan 18 09:41:28 EST 2006


Hi,

I use mod_python based on what is here: 
http://www.modpython.org/pipermail/mod_python/2005-March/017639.html

Customized it a bit to support sessions for example. Using it heavily 
with Cheetah.

My application framework is a bit different though. My pages are defined 
in xml which can include "role" information (who can access what on the 
page). This role information has to conform to the database "role" 
definitions (and is as fine-grained as you want to make it). The xml 
page definition is then stored in the database. When a user requests a 
page, the page executes a db function called GetPage() which passes the 
user id and page name. The database then retrieves the xml page 
definition, goes through it, applies all the db select sql that was 
defined in the xml and substitutes the results as additional xml tags. 
At the same time the xml is "filtered" for the "role" access against the 
user id and all their roles. The modified xml is then returned to the 
mod_python app which applies the xml->html (and all css stuff) to 
produce the final html for the user. This whole approach allows me to 
automate most of the tasks - if a page changes, I change its xml 
definition and run a script to store it in the database. From there it's 
all automated.

Thanks,
Ognen

Daniel Nogradi wrote:

>Some time ago there was a post (I think by Grisha) asking "why are you
>using mod_python?". It would be interesting to see answers from many
>users to a related question, _how_ do you use mod_python?
>
>A little more specifically, the various ways of using mod_python that
>I have in mind (which list is very much limited by my knowledge)
>include
>
>(1) writing custom handlers for every new project
>(2) writing a universal handler which serves various unrelated projects
>(3) using the publisher handler for every project
>(4) tweaking the publisher handler for every new project in different ways
>(5) using the publisher for some of the projects but writing new
>handlers for others
>
>And of course there could be many more ways of using mod_python that
>just didn't come into my mind at the moment or don't even know about
>it.
>
>So, after all, how do you use mod_python?
>
>_______________________________________________
>Mod_python mailing list
>Mod_python at modpython.org
>http://mailman.modpython.org/mailman/listinfo/mod_python
>  
>



More information about the Mod_python mailing list