[mod_python] mptest.py text does not interpret

Willem Fourie fourie_willem at hotmail.com
Fri Apr 5 13:59:01 EST 2002


Hi Reg

1) mptest.py is:
from mod_python import apache

def handler(req):
	req.content_type = "text/plain"
	req.send_http_header()
	req.write("Hello World!")
	return apache.OK

2) and test.py (called from a form):
#!C:\Program Files\Python22\Lib
import cgi

def main():
	print "Content-type: text/html\n"
	form = cgi.FieldStorage()
	if form.has_key("firstname") and form["firstname"].value != "":
		print "<h1>Hello", form["firstname"].value, "</h1>"
	else:
		print "<h1>Error! Please enter first name.</h1>"

main()


1) displays text and 2) tries to download. Only when in webroot. In 
webroot/python it displays the internal error message.


Thanx then


----Original Message Follows----
From: Reg Charney <charney at charneyday.com>
To: Willem Fourie <fourie_willem at hotmail.com>
CC: mod_python at modpython.org
Subject: Re: [mod_python] mptest.py text does not interpret
Date: Thu, 04 Apr 2002 20:37:55 -0800

Could you please send a copy of the test program you are using. All my 
problems
started with an invalid test program. My "fixes" kept on making things worse 
and
worse until I asked the list.

Reg.

Willem Fourie wrote:

 > Hi Reg
 >
 > Thanx very much for your reply, but unfortunately I had already removed 
the
 > AddType (tried with and without).
 >
 > When the ScriptAlias directory points to the WebDir (and mptest.py placed 
in
 > that directory) then it shows the text sans interpretation.
 >
 > With the config pointing to /python, and the file in that directory and 
the
 > URL pointing to /python/mptest.py the server responds with "The server
 > encountered an internal error or misconfiguration and was unable to 
complete
 > your request"
 >
 > Would appreciate ideas on other avenues perhaps.
 > Thanx
 >
 >




_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com




More information about the Mod_python mailing list