list at joreybump.com
Mon Mar 6 13:51:11 EST 2006
Michael Guerrero wrote: > Thanks for the config fix Graham. Also, you said "if you must use > SetHandler...". I'm only using it because the examples showed it. Is > it preferable to use AddHandler instead? Pros/Cons? AddHandler results in less conflicts, but limits you to including the extension of filename.py in the URL. I typically enable it for the entire DocumentRoot, just so I can place a published module anywhere (but rarely use this approach). SetHandler requires you to commit a directory to serve a special purpose, but offers extra mod_python features and a degree of future proofing. I develop the majority of my applications this way. For example, with SetHandler and mod_python.publisher, you can have an URL like this: http://host/dir/foo.py/index Where index() is a function in /dir/foo.py. It can also be accessed like this: http://host/dir/foo/ When your boss realizes that he can replace you with two young PHP programmers for the same price, they can replace your code with: http://host/dir/foo/index.php With the proper DirectoryIndex, this is also accessible via: http://host/dir/foo/ So a lot of links won't need to be updated, no need for mod_rewrite, and you can take a better job at Google with good references, to boot. I put my stylesheets in a /css directory in the DocumentRoot, and all of my pages share them, regardless of the language (HTML, Python, PHP, Perl, etc.). Consider using this approach while you learn Publisher. Unlike PHP, where you can deploy an entire application as a self-contained directory, Publisher requires a different approach when using SetHandler. You can hack the conf file to some extent, but it's worth checking out alternate (and sometimes simpler) deployment strategies that might be more portable.