index.html要放在template文件夹下
渲染模板:
1、静态页面模板放在templates文件夹中
2、需要导入render_template
3、视图函数中使用render_template函数渲染模板本例中使用的是return render_template(‘index.html’, **context)
4、传多个参数的时候可以使用字典的形式如本例中的context={}
5、html代码中参数使用{{}}进行引用 本例中是
用户名:{{ username }}
年龄:{{ age }}
6、传参数类,字典 请看本例中的person类以及context中的wwwurl字典