Vaishnavi Singh
Vaishnavi Singh

Reputation: 43

Flask raises jinja2.exceptions.templatenotfound error

I am trying to render the file bootstrap.html. The file exists in my folder, but I keep getting jinja2.exceptions.templateNotFound: bootstrap.html when I try to render it. Why can't Flask find my template?

@app.route("/bootstrap")
def bootstrap ():
    return render_template('bootstrap.html')```

Upvotes: 0

Views: 633

Answers (1)

johnzarifis
johnzarifis

Reputation: 382

Flask by default is looking for a folder named tempates This is a suggested simple file structure for you project

    app.py
    config.py
    requirements.txt
    static/
    templates/

Upvotes: 1

Related Questions