Forums

Why is the flask foo view page not loading?

Here is what the error log says:

 "line 474, in getattr
2022-09-18 18:09:11,693:     return getattr(obj, attribute)"

Can someone translate this error into plain English and offer a fix?

Here is the code that isn't working:

@app.route("/foo/", methods=["GET", "POST"])
def foo():
    if request.method == "GET":
         return render_template("foo.html", error = False)

Thanks for your assistance in advance.

I'd need to see more context from the traceback, but my guess is that you should provide absolute path for the template.