[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:

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

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

Hello, world!
Has anyone else seen this problem?

Here is my code:

Template File:

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

Python Source:

from mod_python import apache, psp

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



More information about the Mod_python mailing list