1

如果我尝试

  grok.templatedir("../browser/templates")

我明白了

  GrokImportError: The 'templatedir' directive can not contain path separator.

将 Five.grok 模板目录设置为绝对路径的正确方法是什么?

4

2 回答 2

2

“grok.templatedir(directory) - 目录 - 与模块在同一包内的目录名称”

恐怕目前没有正确的办法,确实没有办法。

有一个关于此的未决错误,最终将进行重构。

更多信息:

于 2011-12-28T19:54:27.627 回答
-1
In [1]: from os.path import dirname, join
In [2]: import zopeskel.basic_zope
In [3]: join(dirname(zopeskel.basic_zope.__file__))
Out[3]: '/usr/local/lib/python2.6/dist-packages/ZopeSkel-2.19-py2.6.egg/zopeskel'

but - I dunno if this is the correct way.

best, marco

于 2011-12-28T15:12:35.023 回答