views:

214

answers:

1

I've been a PHP developer for quite awhile, and I've heard good things about using Python for web scripting. After a bit of research, I found mod_python, which integrates with Apache to allow Python Server Pages, which seem very similar to the PHP pages I'm used to. I also found a mod_wsgi which looks similar.

I was wondering which implementation the good people of Stack Overflow would recommend for someone who wants good integration with Apache and MySQL and similar functionality to PHP.

+2  A: 

I believe mod_wsgi is the preferred option to mod_python:

http://code.google.com/p/modwsgi/

Some performance benchmarks seem to suggest that mod_wsgi performs much better also.

http://code.google.com/p/modwsgi/wiki/PerformanceEstimates

Jon
Can mod_wsgi handle Python Server Pages in the same way that this does? http://webpython.codepoint.net/mod_python_psp_hello_world More specifically, does it allow me to embed blocks of Python into an HTML page using delimiters?
DLH
I think Python Server Pages is a feature of mod_python - so prob not, somebody correct me if I'm wrong here. However, there are loads of templating languages with Python (http://wiki.python.org/moin/Templating)... and (http://stackoverflow.com/questions/98245/what-is-your-single-favorite-python-templating-engine).Why do you want to use PSP in particular?
Jon
I like the way PHP is embedded into HTML, and I wanted to do the same with Python.
DLH
Ok, you should take a look at Spyce if you're going to go down the mod_wsgi route - http://spyce.sourceforge.net/docs/doc-intro_rationale.html It's very similar with the same design principles as PSP.
Jon
Thanks! I'll check it out.
DLH
The long term viability of mod_python is currently also in question. This and use of PSP was just today begin discussed on mod_python list. See 'http://www.modpython.org/pipermail/mod_python/2009-July/026276.html'. Use of an alternate templating system on top of WSGI is definitely a better long term solution.
Graham Dumpleton