from flask import Flask,render_template
app = Flask(__name__, template_folder='home/root13/webapp.html/staic/')
@app.route("/index.html")
def hello():
return render_template('index.html')
@app.route("/home")
def hello_world():
return render_template('post.html')
if __name__ == "__main__":
app.run(debug=True)
答案 0 :(得分:0)
Flask将尝试在存在此脚本的文件夹中的templates文件夹中查找HTML文件。
-Application folder
-Hello.py
-templates
-hello.html
您应将所有HTML文件放在名为模板
的文件夹中