I tried to render an "html" file using Flask(Jinja2) in Python, but it showed me an error. My controller ".py file":-
from flask import Flask, render_template
app = Flask(__name__)
@app.route("/profile/<name>")
def profile(name):
return render_template('profile.html', name=name)
if __name__ == "__main__":
app.run(debug=True)
My template "profile.html" file:
<h1>Welcome To Your Profile, {{ name }}</h1>
When I ran the flask app, it gave me the following exception:-
jinja2.exceptions.TemplateNotFound: template\profile.html