[mod_python] web app framework suggestions?

Lewis Bergman lbergman at abi.tconline.net
Wed Feb 13 11:21:34 EST 2002


I have read the manual about a dozen times now.
I think I understand some of what seem to me to be subtleties about 
mod_python. Not to bore anyone but to make sure I do here is what I see that 
has given me the most problems:

mod_python will not directly run a class - I know this is in the manual but I 
didn't catch on to a module being the same thing as a class for some reason. 
I remember something about security about this in the manual so we won't go 
on about inconvenience here.

mod_python will run a class from inside a standard python file or function.

The standard method of linking is to add the current files name to any linked 
argument. - I really had a hard time with this one. I remember the manual 
stating that it adds the current file to the path but I didn't think it was 
talking about this. Meaning that if I want to jump to another file (say 
new.py) from current.py I have to code the entire docroot in so that 
current.py is not appended. a small deal but still took some getting used to. 
I guess you have to default to something huh?

So I guess the question is..
Is there a recommended way to build a semi largish app with mod_python?

Maybe use standard files with functions to front end classes that generate 
pages based on how the classes/methods are called?

I am using this to build a web front end to an ISP package that controls 
billing/activation of customers on linux servers. Many of the tasks will be 
the same for a lot of different system users. For example; An ISP admin will 
need to add customers, just like a agent will. A user, agent, and admin will 
all most likely need to change a user password or username at some point.

So... how best to break these functional areas down. I am leaning to wards 
(and have started coding) classes to generate HTML like forms, results of db 
queries, simple info display, menu generation. I am also thinking of classes 
to do the queries, and such. i am finished with all the classes to do the 
actual system changes (which I thought would be the hard part, I was wrong)

Does this sound reasonable? Is there a better way?

Forgive me for stupid questions but I am pretty new to python, its OO ways,  
and a mod_python baby. I have done a lot of web coding in php but decided on 
python for this because of the scale of it. PHP for all its pluses is only 
faking OO and doesn't seem to scale very well. Namespace can drive you crazy 
on it! I am trying to make this app 100% python because I think in the long 
haul I believe it will be more maintainable.

Any advice would be appreciated.
-- 
Lewis Bergman
Texas Communications
4309 Maple St.
Abilene, TX 79602-8044
915-695-6962 ext 115



More information about the Mod_python mailing list