errors - pkirlin/lab-flask GitHub Wiki
What do I do with a Bad Request error?
Bad Request: The browser (or proxy) sent a request that this server could not understand.
If you see this error message, what this usually means is that you tried to use a variable in your Python code that should have been sent via an HTML form, but wasn't. Check for mis-namings between your HTML form variables and your Python variables. To help you debug, you can put print(request.form) at the top of any Python function.
template not found
Make sure your templates folder is inside the folder for your application. In other words,
inside of flask-apps, you probably have a folder with the name of your application, such as
first, where your .py file lives. Your templates folder should be inside of first.
ImportError: No module named [something]
You ran flask run from the wrong directory/folder. You should run this command from the
folder where your Flask application (python code) lives.
To fix this, do cd name-of-folder. For instance cd flask-apps/first.
Address already in use
You run flask run when it was already running. To stop the currently-running version, type pkill -9 flask.