Forums

I am getting an error from a file that does not exist

When I try to visit my website at whatsfordinner.pythonanywhere.com, I get the following error in the error log:

File "/home/whatsfordinner/mysite/flask_app.py", line 10, in hello_world return render_template("hello.html") NameError: name 'render_template' is not defined

My source code is located in a directory called "whatsfordinner", and I have deleted the mysite directory. The python file my code is running in is called "application.py." I have attached pictures of my file tree and configuration. whatsfordinner directory (application) whatsfordinner directory (source code) Configuration information

Do you import render_template anywhere in that file?

I do in whatsfordinner/application.py, but I don’t know about my site/flask_app.py because I deleted it.

Are you looking at the most recent error? The error log persists over time; the most recent error message will be at the bottom of the file. Also, each line in the file has a date/timestamp on it, which should help identify what time a particular error message was written.