文章详情页
python - flask问题
浏览:76日期: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 }}
现在xxx.py
return render_template(’home.html’,posts_list=get_posts_list)
怎么让recent_post.html里的posts_list获取到传过去的值呢
标签问题
问题解答
回答1:<ul>{% for i in posts_list %}<li>{{i}}</li>{% endfor %}</ul>回答2:
标签问题autoescape导致的
上一条:python - 要抓取的网页内容在括号里,正则怎么写?下一条:flask - python jinja2 如何从获取javascript function(_index) 传过来的参数 index?
相关文章:
1. android - 安卓做前端,PHP做后台服务器 有什么需要注意的?2. docker images显示的镜像过多,狗眼被亮瞎了,怎么办?3. mysql - 我用SQL语句 更新 行的时候,发现全部 中文都被清空了,请问怎么解决?4. python - xpath提取网页路径没问题,但是缺失内容?5. javascript - IOS微信audio标签不能通过touchend播放6. java中这个页面默认是utf-8编码的,1输出乱码可以理解,可是2就不理解了?7. python-mysql Commands out of sync8. docker不显示端口映射呢?9. javascript - 求教各位,本地HTML页面怎么在DIV中嵌套服务器上的页面内容?不用iframe。10. docker start -a dockername 老是卡住,什么情况?
排行榜
