【发布时间】:2016-01-28 12:32:14
【问题描述】:
从flask实现一个简单的静态站点,但是浏览器说找不到模板,shell返回404
jinja2.exceptions.TemplateNotFound
TemplateNotFound: template.html
主要python代码:
from flask import Flask, render_template
app = Flask(__name__)
@app.route("/")
def template_test():
return render_template('template.html', my_string="Wheeeee!", my_list=[0,1,2,3,4,5])
if __name__ == '__main__':
app.run(debug=True)
我的文件结构如下:
flask_new_practice
|--template/
|--template.html
|--run.py
【问题讨论】: