11
实现从烧瓶一个简单的静态网站,但是浏览器说找不到模板,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
你可以请你把它指向它的位置请问。我想知道。这些答案并没有解决我的问题。 – saviour123