文章詳情頁(yè)
python - flask問題
瀏覽:87日期:2022-09-02 09:08:56
問題描述
問題home.html
{% extends 'base/base.html' %}{% block title %}Home{% endblock %}{% block content %} {% include './recent_post.html' %}{% endblock %}
recent_post.html
{{ posts_list }}
現(xiàn)在xxx.py
return render_template(’home.html’,posts_list=get_posts_list)
怎么讓recent_post.html里的posts_list獲取到傳過去的值呢
標(biāo)簽問題
問題解答
回答1:<ul>{% for i in posts_list %}<li>{{i}}</li>{% endfor %}</ul>回答2:
標(biāo)簽問題autoescape導(dǎo)致的
上一條:python - 要抓取的網(wǎng)頁(yè)內(nèi)容在括號(hào)里,正則怎么寫?下一條:flask - python jinja2 如何從獲取javascript function(_index) 傳過來的參數(shù) index?
相關(guān)文章:
1. mysql - 把一個(gè)表中的數(shù)據(jù)count更新到另一個(gè)表里?2. mysql 查詢身份證號(hào)字段值有效的數(shù)據(jù)3. node.js - 為什么微信的消息MsgId出現(xiàn)重復(fù)了,無法排重了。。4. mysql的主從復(fù)制、讀寫分離,關(guān)于從的問題5. MySQL 截短某一列的字符串6. 請(qǐng)教使用PDO連接MSSQL數(shù)據(jù)庫(kù)插入是亂碼問題?7. mysql - 分庫(kù)分表、分區(qū)、讀寫分離 這些都是用在什么場(chǎng)景下 ,會(huì)帶來哪些效率或者其他方面的好處8. mysql - 字符串根據(jù)字典替換9. 視頻文件不能播放,怎么辦?10. node.js - nodejs開發(fā)中常用的連接mysql的庫(kù)
排行榜

熱門標(biāo)簽