[mod_python] Firefox - Showing Output Source

Joshua Cohen JoshC at usracmfg.com
Tue Jul 12 10:59:27 EDT 2005


Hello everyone. 

I am attempting to use PSP as a template for outputting Python programs. The problem I am having is when I run the example given in the Mod_Python doc's, Firefox displays the full source as the output. The variables will be replaced as specified, however all of the source is visible on the page. e.g: 

The output on Firefox is:

<html>
  <!-- This is a simple psp template called template.html -->
  <h1>Hello, world!</h1>
</html>0

However, Internet Explorer displays the output properly and all that is output is :

Hello, world!
0
Has anyone else seen this problem?

Here is my code:

Template File:

<html>
  <!-- This is a simple psp template called template.html -->
  <h1>Hello, <%=what%>!</h1>
</html>

Python Source:

from mod_python import apache, psp

def handler(req):
    template = psp.PSP(req, filename='../hello.html')
    template.run({'what':'world'})
    return apache.OK

Thanks!

Josh



More information about the Mod_python mailing list