d.holton at vanderbilt.edu
Sun Mar 7 10:07:14 EST 2004
> Newbie here. Before Grisha released psp, I started using Spyce with > apache/python. I'm really still new to python, apache etc. not a web > guy by training. I've been skimming the group archives to see some > comparisons of Spyce and Grisha's PSP. > > Can someone give some insight into how these two approaches compare? Is > there a reason for both to exist? Like others have mentioned, PHP mixes code in with HTML can get messy. One solution in PHP is to use the Smarty templating system to separate the view (the html) and the data (like the results of a database query for example). It looks like you can do something similar with PSP or Cheetah but not Spyce. See "Using PSP as a Templating System" here: http://www.onlamp.com/pub/a/python/2004/02/26/python_server_pages.html Smarty, PSP, and Cheetah have speed optimizations too: they can cache a parsed template so that it only has to be parsed once. See the PSPDbmCache option to make PSP cache to files instead of using up memory. A possible disadvantage of PSP though is that it is tied to mod_python, whereas Spyce or other frameworks like Quixote can be used with or without mod_python.