bottle.py模板路径有什么问题?

时间:2016-09-24 09:34:05

标签: python bottle

我正在尝试向我的网页添加国际化。让我们说,路线是/ RU / index

@route('/<path>/<page:re:.*>')
def callback(path, page):
    fullpath = ('/%s/%s.html' % (path, page))
    print('fullpath %s' % fullpath)
    return template(fullpath)

为什么它不从/views/RU/index.html中的文件返回模板?

1 个答案:

答案 0 :(得分:1)

只需添加TEMPLATE_PATH路径

即可
A
相关问题