Forum Stats

  • 3,876,129 Users
  • 2,267,066 Discussions
  • 7,912,443 Comments

Discussions

mod_python error. Webpage displays .py source code

703653
703653 Member Posts: 1
edited May 27, 2009 1:44PM in Python
Hello

I'm new to Python and I have a problem with mod_python. Firefox webpage displays source code of .py file instead of result. Could any one help me with this issue?

My versions are: RHEL 5, Oracle 10g, Python 2.6, mod_python 2, Apache 2.2

here is httpd.conf file's contents:

<Directory /usr/local/apache/htdocs/modules>
Options Indexes FollowSymLinks Multiviews
AllowOverride None
Order allow,deny
allow from all
AddHandler python-program .py
PythonHandler or1
PythonDebug On
</Directory>

and that's my Python source code (or1.py):

from mod_python import apache
def handler(rep)
req.content_type = 'text/plain'
req.write('Hello World')
return apache.OK

Answers

This discussion has been closed.