David Jackson
davidj411 at gmail.com
Tue Dec 30 11:15:22 EST 2008
2 things i wanted to find out more about : 1) Graham, i took your advice "By using AddHandler for both so that files with different extensions can exist in same directory and be processed appropriately." I then "only enabled mod_python.publisher" and from inside of publisher functions access to PSP class directly to render pages you supply references to and return that as result. *current httpd.conf config is* *<Directory "C:/www/pybin"> AllowOverride None Options None Order allow,deny Allow from all AddHandler mod_python .py* * AddHandler mod_python .psp PythonHandler mod_python.publisher PythonDebug On </Directory>* ** ** *contents of test2.psp:* *from mod_python import PSP* *<% for n in range(10): a= "testing" + str(n) req.write(a) %>* *error on page test2.psp shows :* * <%* * ^* *SyntaxError: invalid syntax* ** ** 2) Question was: *"Warning bells ringing. Why are you picking mod_python/publisher/psp in the first place when there are arguably much better alternatives available today for doing Python web application? " * I'd like to hear about some of the options that are better than mod_python. performance and security are important. The abilty to manage code is also important. what else is considered important when picking the "framework" (for lack of better word) for python web apps? Thanks! On Sat, Dec 27, 2008 at 4:46 AM, Graham Dumpleton < graham.dumpleton at gmail.com> wrote: > 2008/12/27 David Jackson <davidj411 at gmail.com>: > > I am wondering if there are any docs that might address these questions: > > > > 1) can PSP handler and Publisher handler be used simultaneously? > > Yes. > > By using AddHandler for both so that files with different extensions > can exist in same directory and be processed appropriately. > > Alternatively, only enable mod_python.publisher and from inside of > publisher functions access to PSP class directly to render pages you > supply references to and return that as result. > > > is it advisable to use one or the other, but not both? > > Depends on what you want to do. > > Why are you picking mod_python/publisher/psp in the first place when > there are arguably much better alternatives available today for doing > Python web application? > > > what are the differences b/t the two in terms of performance? > > Hmmm, warning bells ringing. There are a lot more important things > than raw performance. You would be better of finding a system that you > like to use rather than be obsessed over performance. > > > 2) what is difference b/t directives > > > > A) AddHandler - > > http://httpd.apache.org/docs/1.3/mod/mod_mime.html#addhandler > > B) SetHandler - > > http://httpd.apache.org/docs/1.3/mod/mod_mime.html#sethandler > > > > it seems like you could use either, but which is best? sethandler seems > to > > be for all files at directory level, while addhandler allows you to > specify > > the extension. > > Use SetHandler and you can't mix different file types in same > directory easily as it takes precedence. > > > my httpd.conf working config is posted below, questionable parts are > in > > bold. > > Can someone advise on if this configuration will work? > > > > <Directory "C:/Documents and Settings/davidj411/My Documents/www/pybin"> > > AllowOverride None > > Options None > > Order allow,deny > > Allow from all > > SetHandler mod_python > > > > PythonHandler mod_python.publisher > > AddHandler mod_python .psp > > PythonHandler mod_python.psp > > > > PythonDebug On > > </Directory> > > From memory this would cause publisher files to take precedence all > the time, you cannot normally mixed SetHandler and AddHandler within > same directory context. > > Graham > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20081230/42356ef2/attachment.html
|