-1

I am trying to render the file index.html, but I keep getting

jinja2.exceptions.TemplateNotFound: index.html

when I try to render it. Why can't Flask find my template

app=Flask(__name__,template_folder='templates')


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

and my file location is like (i chance Tamplates to tamplates)

File location

sinan urgun
  • 11
  • 1
  • 3

1 Answers1

1

so you must define the template folder path like this.

if you named your template folder: Tamplates

Then use this

app = Flask(__name__, template_folder='Tamplates')

Fareed Khan
  • 2,613
  • 1
  • 11
  • 19