您的位置:首页 > 其它

flask-themes 出现TemplateNotFound问题

2013-03-17 00:00 225 查看
今天学习flask-themes(https://bitbucket.org/leafstorm/flask-themes/src),运行源码中的example时发现模板不起作用,解决办法:https://bitbucket.org/leafstorm/flask-themes/pull-request/2/fix-to-make-jinjas-include-and-import/diff

flaskext/themes.py line:419

@contextfunction



def global_theme_template(ctx, templatename, fallback=True):



theme = active_theme(ctx)



-    templatepath = '_themes/%s/%s' % (theme, templatename)



+    if USING_BLUEPRINTS:



+        templatepath = '%s/%s' % (theme, templatename)



+    else:



+        templatepath = '_themes/%s/%s' % (theme, templatename)



if (not fallback) or template_exists(templatepath):



return templatepath



else:
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐