首页  >  问答  >  正文

python+jinja2编写前端界面,发生Unexpected end of template问题,求解决!

<!DOCTYPE html >
<html>
<head>
<title>{{title}}</title>

<元名称=“viewport”内容=“宽度=设备宽度,initial-scale=1.0”>

<链接 rel="stylesheet" href="https://maxcdn.bootstrapcdn.c...integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">

<风格>
桌子{

雷雷

td{

雷雷

第{

雷雷

.父母{

雷雷

.奇数{

雷雷

.已选择{

雷雷


<身体>

雷雷 雷雷 雷雷 雷雷 雷雷 雷雷 雷雷 雷雷 雷雷

</html>
将这个接口模板渲染,提示这个错误
jinja2.exceptions.TemplateSyntaxError: Unexpected end of template。 Jinja 正在寻找以下标签:“endfor”或“else”。需要关闭的最里面的块是“for”。

ringa_leeringa_lee2701 天前1297

全部回复(1)我来回复

  • 伊谢尔伦

    伊谢尔伦2017-05-27 17:41:39

    for 总共四个,endfor总共三个,所以楼主应该写少一个endfor吧,所以导致语法错误!

    回复
    0
  • 取消回复