[mod_python] simpleTAL - 500 Internal Server Error

Erdi Balint erdibalint at freemail.hu
Wed Oct 12 02:51:29 EDT 2005

Hi all,

I'm trying to use simpleTAL templates with no success. When querying the 
python script that expands the template I get the following:

"Internal Server Error
The server encountered an internal error or misconfiguration and was 
unable to complete your request.

Please contact the server administrator, webmaster at localhost and inform 
them of the time the error occurred, and anything you might have done 
that may have caused the error.

More information about this error may be available in the server error log."

Apache/1.3.33 Server at localhost Port 80

The apache error log is not verbose and does not contain a stack trace, 
only this:

[Wed Oct 12 08:42:37 2005] [notice] mod_python: (Re)importing 
mod_python.publisher from None
[Wed Oct 12 08:42:37 2005] [notice] mod_python: (Re)importing simple 
from ['/var/www/helloSimpleTAL/control']

My code:

import sys
from simpletal import simpleTAL, simpleTALES
def hello(req):

     # Create the context that is used by the template
     context = simpleTALES.Context()
     context.addGlobal ("title", "Hello World")

     templateFile = open ("/var/www/helloSimpleTAL/simple.html", 'r')
     template = simpleTAL.compileHTMLTemplate (templateFile)
     template.expand (context, sys.stdout)
     # (1)
My Directory directive in apache:

<Directory /var/www/helloSimpleTAL/control>
         SetHandler python-program
         PythonHandler mod_python.publisher
         PythonDebug on

I've found someone had the same problem before on this mailing list and 
got answered that this is a bug in mod_python 2.7.10, so I added a

return " " to (1) above, but that only returned an empty page (and if I 
do return "x", a page with an 'x' will be rendered)

I'm using Python 2.3.4, Apache 1.3.33, mod_python 2.7.11 and I've got 
the publisher handler to work beforehand, just not with simpleTAL :(

Can anyone help me with this?

Thanks a lot in advance,

More information about the Mod_python mailing list