文章詳情頁
python - flask問題
瀏覽:172日期: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)頁內(nèi)容在括號(hào)里,正則怎么寫?下一條:flask - python jinja2 如何從獲取javascript function(_index) 傳過來的參數(shù) index?
相關(guān)文章:
1. docker綁定了nginx端口 外部訪問不到2. 前端 - html5 audio不能播放3. javascript - 最近用echarts做統(tǒng)計(jì)圖時(shí)遇到兩個(gè)問題!!4. javascript - 深夜被問題困擾求解惑,rn的API之PermissionsAndroidd的問題5. mysql - 我的myeclipse一直連顯示數(shù)據(jù)庫連接失敗,不知道為什么6. redis sentinel怎么跑守護(hù)進(jìn)程以及日志記錄位置的?7. android權(quán)限被第三方安全軟件禁止,如何獲取該權(quán)限狀態(tài)8. android - 優(yōu)酷的安卓及蘋果app還在使用flash技術(shù)嗎?9. 利用百度地圖API定位及附件商家信息服務(wù)10. nginx - ssl加密訪問證書不受信任
排行榜

熱門標(biāo)簽
網(wǎng)公網(wǎng)安備