python+jinja2寫前端介面,發生Unexpected end of template問題,求解決!
ringa_lee
ringa_lee 2017-05-27 17:39:39
0
1
1295

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

<元名稱=“視口”內容=“寬度=裝置寬度,初始比例= 1.0”>

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.c...integrity="sha384-1q8mTJOASx8j1Au a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGm">s7 crossoriginz="

<樣式>

表格{
雷雷

td{

雷雷

第{

雷雷

.父{

雷雷 ###。奇怪的{### 雷雷

.已選擇{

雷雷

</style>

</head>

<內文>

<p class="容器">

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

</腳本>

</body>

</html>

將這個介面範本渲染,提示這個錯誤

jinja2.exceptions.TemplateSyntaxError: Unexpected end of template。 Jinja 正在尋找以下標籤:「endfor」或「else」。需要關閉的最裡面的區塊是「for」。

ringa_lee
ringa_lee

ringa_lee

全部回覆(1)
伊谢尔伦

for 總共四個,endfor總共三個,所以樓主應該寫少一個endfor吧,所以導致語法錯誤!

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!