【发布时间】:2014-12-25 17:10:18
【问题描述】:
好的,在 python 中运行:
from mako.lookup import TemplateLookup
from mako.template import Template
mylookup = TemplateLookup(directories=['/home/user/webapps/app/www/templates/'])
mytemplate = Template(filename='/home/user/webapps/app/www/templates/content.html.mako', lookup=mylookup)
print (mytemplate.render(title="Title", content={'hi'}))
当这是 content.html.mako 的开头时
## content.html.mako
<%inherit file="frame.html.mako"/>
给我这个:
mako.exceptions.TemplateLookupException: Cant locate template for uri '/home/user/webapps/app/www/templates/frame.html.mako'
但是frame.html.mako和content.html.mako在同一个目录下,这是怎么回事?
【问题讨论】: