Flask raises TemplateNotFound error even though template file exists
问题 I am trying to render the file home.html . The file exists in my project, but I keep getting jinja2.exceptions.TemplateNotFound: home.html when I try to render it. Why can't Flask find my template? from flask import Flask, render_template app = Flask(__name__) @app.route('/') def home(): return render_template('home.html') /myproject app.py home.html 回答1: You must create your template files in the correct location; in the templates subdirectory next to the python module (== the module where