flask开中发遇到jinja2.exceptions.TemplateSyntaxError: unexpe
发布时间:2020-12-17 17:03:43 所属栏目:Python 来源:网络整理
导读:flask开中发遇到jinja2.exceptions.TemplateSyntaxError: jinja2.exceptions.TemplateSyntaxError:?unexpected?'}',?expected?')' 提示告诉在jinjia模板中括号使用错误 代码: {%?extends?"base.html"?%}{%?import?"bootstrap/wtf.html"?as?wtf?%}{%?import?'
flask开中发遇到jinja2.exceptions.TemplateSyntaxError: jinja2.exceptions.TemplateSyntaxError:?unexpected?'}',?expected?')' 提示告诉在jinjia模板中括号使用错误 代码: {%?extends?"base.html"?%} {%?import?"bootstrap/wtf.html"?as?wtf?%} {%?import?'_marcos.html'?as?macros?%} {%?block?title?%}Flasky{%?endblock?%} {%?block?page_content?%} <div?class="page-header"> ????<h1>Hello,?{%?if?current_user.is_authenticated?%}{{?current_user.username?}}{%?else?%}Stranger{%?endif?%}!</h1> </div> <div> ????{%?if?current_user.can(Permission.WRITE_ARTICLES)?%} ????{{?wtf.quick_form(form)?}} ????{%?endif?%} </div> {%?include?'_posts.html'?%} {%?if?pagination?%} ????<div?class="pagination"> ????{{?macros.paginnation_widget(pagination,?".index"?}} ????</div> {%?endblock?%} 经过检查发现原来是这句代码出错{{ macros.paginnation_widget(pagination,".index" }}中少了一个“)” 更正为: {{?macros.paginnation_widget(pagination,?".index"?}} (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |