问题描述
我需要以下代码的帮助。问题是第一个render_template工作,但是第二个不工作
import requests app = Flask(name,template_folder='venv/templates/')
@app.route('/') def accueil(): mots = ["bonjour","à","toi,","visiteur."] return render_template('accueil.html',titre="Bienvenue !",mots=mots)
@app.route('/') def hello(): h = 'hello world' return render_template('accueil.html',message=h)
if name == 'main': app.run(debug=True)
`<body>
<h1>{{ titre }}</h1>
<ul>
{% for mot in mots %}
<li>{{ mot }}</li>
{% endfor %}
</ul>
<table >
<tr>
<td>content of message is: </td>{{ message }}
</tr>
</table>
</body>`
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)