Reputation: 21
This is the full error we receive when running the flask application in the browser.
"Internal Server Error The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application."
I've done some research and have already attempted to link the folder with the
app = Flask(__name__, template_folder='/templates')
assignment.
Here is my directory and debug logs. Any insight would be appreciated.
Upvotes: 1
Views: 269
Reputation: 10624
Your code needs some changes. First of all, try using
render_template('prediction.html')
instead of
render_template('templates/prediction.html')
as Flasks already looks at templates folder (which in this case means that it will look for a folder 'templates' inside the folder 'templates')
If this doesn't work, try the same but when you declare the folder do it by:
app = Flask(__name__, template_folder='/templates')
(with '/' before templates) and not your current
app = Flask(__name__, template_folder='templates')
If nothing of the above works, just the same solutions, without declaring template_folder at all, as by default Flask looks in the folder named 'templates'
Upvotes: 0