Flask raises TemplateNotFound error even though template file exists

前端 未结 11 1384
别跟我提以往
别跟我提以往 2020-11-21 23:02

I am trying to render the file home.html. The file exists in my project, but I keep getting jinja2.exceptions.TemplateNotFound: home.html when I t

11条回答
  •  情深已故
    2020-11-21 23:21

    I don't know why, but I had to use the following folder structure instead. I put "templates" one level up.

    project/
        app/
            hello.py
            static/
                main.css
        templates/
            home.html
        venv/
    

    This probably indicates a misconfiguration elsewhere, but I couldn't figure out what that was and this worked.

提交回复
热议问题