Sunday, January 23, 2011

what do I need to run python on my webserver ?

what do I need to run python on my webserver ?

Should I enable some Apache module ?

Thanks

  • Yea, you need mod_python.

    Or you can enable cgi support by putting in a AddHandler cgi-script .py directive in your httpd.conf...You'll need to put a cgi shebang on the first line of your script as well (i.e. !#/usr/bin/python).

  • Make sure you also look at mod_wsgi. It's a nice alternative to running mod_python. Also, depending on your application, FastCGI is also an option (see packages like flup, which kind of acts as a bridge between FastCGI & WSGI).

    David Zaslavsky : +1 mod_wsgi is the preferred way of doing it these days.
    From McJeff

0 comments:

Post a Comment