Just like php, or perl , python can also be executed on the server-side.
Install Apache (I generally use WAMP for Apache), install python, find the correct mod_wsgi depending upon your Python version, apache version and OS arch from here
Now, you need to insert following configuration in your httpd.conf file of Apache and restart the apache
## Following change need to be done after all LoadModule
LoadModule wsgi_module modules/mod_wsgi.so
#at the end of the file add following directive
<Directory "C:/wamp/www/python/">
Options ExecCGI
SetHandler cgi-script
</Directory>
this directive will tell Apache to consider the given directory for cgi execution, all python files need to be present in this directory in order to be executed rather than being spit out by the web-server.
No comments:
Post a Comment