I am trying to setup Python with WSGI for a particular directory on Apache but I am getting the following error:
mod_wsgi (pid=3857): Target WSGI script '/var/www/test/test.py' does not contain WSGI application 'application'.
My test.py contains:
print 'Hello, World!'
And my wsgi.conf contains:
LoadModule wsgi_module modules/mod_wsgi.so
WSGIPythonHome /usr/local/bin/python2.7
Alias /test/ /var/www/test/test.py
<Directory /var/www/test>
SetHandler wsgi-script
Options ExecCGI
Order deny,allow
Allow from all
</Directory>
On top of all that, interestingly enough, the web browser returns a “404 Not Found” error but thankfully the error_log is a little more enlightening.
What am I doing wrong?
You’re using WSGI as though it was CGI (strangely without headers).
What you need to do, for your immediate problem is adapt the following from http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide
So that you have
applicationpresent.And from the referenced doc.