[mod_python] Re: web app framework suggestions?

Aaron Fransen aaronf at telusplanet.net
Thu Feb 14 18:45:49 EST 2002




I have a feeling this reply will show up in HTML format only, so my apologies to the group...

Regarding a web app, I think you hit it right on the head. I've use the publisher app and a single module to front an entire application, in fact applications: My first crack at Python is a web-based mail client (http://gomail.dynu.com) which is coming along nicely, and supports groups calendars etc., but for a mail client it was a lot more work than I thought it was going to be!

By comparison, the e-commerce site I created for my employer was simple, but it used the same techniques. In all, each app uses about a dozen separate modules of my own, with two of those being class collections for various functions (ie. html specs, database connectivity).

Now, I never learned Perl or C/C++, but I'm a VB developer since v1.0, and developing a web app in VB was positively painful in comparison. mod_python's a bear to get going the first time, but man, is it stable once it's up and running. If I ever go back to Microsoft, it'll only be to do Python.NET.

Aaron Fransen.

On Feb 14, 2002, Lewis Bergman wrote:

Re: web app framework suggestions? 

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 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.modpython.org/pipermail/mod_python/attachments/20020214/497d1be7/attachment-0003.htm


More information about the Mod_python mailing list