Ksenia
unread,Apr 20, 2009, 10:51:35 AM4/20/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Mako Templates for Python
Hi,
I am testing my home-made WSGI app with ab. To increase performance
I've added module_directory parameters and filesystem_checks to
TemplateLookup. It works great, the rendering is much faster, but with
module_directory parameter added, 1 or 2 of 100 requests fail. On the
debug page I can see a traceback:
(copy-paste from Weberror page)
[...]
Module page_html:24 in _mako_inherit view
>> return runtime._inherit_from(context, 'master.html', _template_uri)
Module mako.runtime:297 in _inherit_from view
>> template = _lookup_template(context, uri, calling_uri)
Module mako.runtime:322 in _lookup_template view
>> return lookup.get_template(uri)
Module mako.lookup:85 in get_template view
>> return self.__load(srcfile, uri)
Module mako.lookup:127 in __load view
>> self.__collection[uri] = Template(uri=uri, filename=posixpath.normpath(filename), lookup=self, module_filename=(self.modulename_callable is not None and self.modulename_callable(filename, uri) or None), **self.template_args)
Module mako.template:84 in __init__ view
>> del sys.modules[self.module_id]
KeyError: 'master_html'
Is this something in environment that brings Mako down? I can imagine
that my home-grown WSGI app / framework is not as reliable as some
well-tested frameworks. Or is this due to some OS limitations? (OSX
10.5)
Thanks
Ksenia