在烧瓶中找不到庙宇

时间:2019-12-10 05:13:07

标签: python flask

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)

1 个答案:

答案 0 :(得分:0)

Flask将尝试在存在此脚本的文件夹中的templates文件夹中查找HTML文件。

-Application folder
  -Hello.py
  -templates
    -hello.html

您应将所有HTML文件放在名为模板

的文件夹中
相关问题