ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button
  Mod_python's PSP: Python Server Pages
Subject:   problem executing template example
Date:   2004-12-21 08:40:05
From:   ChristianPinedo

I can not execute the template example at a GNU/Linux workstation with apache2 and mod_python 3.1.3. Whenever I tried it, the browser (Firefox 1.0 and Epiphany 1.4.5) downloaded a file that was the generated html page but not browsed it.

To solve this I had to add a line to pubpsp.py:

def hello(req, name=''):
s = 'Hello. there!'
if name:
s = 'Hello, %s!' %
req.content_type = 'text/html' # this !!
tmpl = psp.PSP(req, filename='hello.tmpl')
tmpl.run(vars = {'greets': s})

This is the only solution i have found.