Saturday, 17 August 2013

Python / Mod_wsgi : installed python + mod_wsgi but not working via web browser / apache. shows source code.

Python / Mod_wsgi : installed python + mod_wsgi but not working via web
browser / apache. shows source code.

I have python 2.7 as well as mod-wsgi installed.
after installing mod-wsgi i ran this command.
cat > /etc/httpd/conf.d/wsgi.conf << EOF
LoadModule wsgi_module modules/mod_wsgi.so
EOF
when i run locate mod_wsgi this is the result.
/usr/lib64/httpd/modules/mod_wsgi.so
in my httpd.conf file i have..
NameVirtualHost *:80
DocumentRoot "/media/1/1/1/"
DirectoryIndex index.wsgi
i restarted apache
and then visited the localhost ( index.wsgi )
it shows the whole source code.
def application(environ, start_response):
start_response('200 OK', [('content-type', 'text/html')])
yield 'a'
what did i do wrong ?

No comments:

Post a Comment