[Zope] How do I get DocumentTemplate to work?

Bill Hewitt wphewitt at comcast.net
Sat Aug 16 06:42:22 EDT 2003


I'm trying to switch over to python from DTML......
I've got a python Script (to see what DocumentTemplate does) that looks
like the following:

from DocumentTemplate import HTML
template_source = """
<html>
  <head>
    <title> <dtml-var title_or_id></title>
  </head>
  <body>
  <dtml-var content>
</body>
</html>
"""
template_method = HTML(template_source)
results = template_method(title="ThisDocument!",
                          content="This is cool!!!!" )

But, when I try to run it, I get:
Error Type: ImportError
Error Value: import of "HTMLFile" from "DocumentTemplate" is
unauthorized. You are not allowed to access HTMLFile in this context

What is it I'm doing wrong?

TIA,
WPH





More information about the Zope mailing list