I am trying to render the template of index.html using Flask. I get an error that the file is not found. The error is jinja2.exceptions.TemplateNotFound: template/index.html. The file exists in the templates folder and it has the name index.html
`from flask import Flask, render_template
app = Flask(__name__, template_folder="template")
@app.route("/")
def home():
return render_template("template/index.html")
if __name__ == "__main__":
app.run(debug=True)`
I have already tried creating a directory called templates and putting the html file there - as suggested to some users here
I also tried changing the name of the files and the directory (template and templates)
I have tried importing jinja2