jinja2.exceptions.TemplateNotFound: result.html code example

Example 1: jinja2.exceptions.templatenotfound: templates/index.html

app = Flask(__name__, template_folder={path of template directory})

Example 2: jinja2.exceptions.templatenotfound: templates/index.html

from flask import Flask, render_template
app = Flask(__name__)
@app.route("/profile/")
def profile(name):
    return render_template('profile.html', name=name)
if __name__ == "__main__":
    app.run(debug=True)

Example 3: jinja2.exceptions.templatenotfound: templates/index.html

from flask import Flask, render_template

app = Flask(__name__)

@app.route('/')
def home():
    return render_template('home.html')

Tags:

Misc Example