第一个render_template工作,但是第二个不工作

时间:2020-09-06 13:46:21

标签: templates flask return render

我需要以下代码的帮助。问题是第一个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>`

0 个答案:

没有答案