This question has been answered a few times but it took me a while to understand what I was looking for specific to my (subtly different) problem, so I just want to throw in that the generic answer here is this:
Somewhere in your code, you're defining a route but not returning anything. This code returns a template:
@app.route('/welcome')
def welcome():
return render_template("welcome.html")
This code only returns a template under some circumstances:
@app.route('/welcome')
def welcome():
if request.method == "POST":
return render_template("welcome.html")
So if you're really not sure why you are seeing ValueError: View function did not return a response
walk through your code and make sure that all your route definitions (def foo():
) actually return
something, and that something isn't nested inside of an if clause
It is pretty annoying that the error doesn't give a lot of clues about where it is getting stuck, but I'm sure a more experienced Pythoner could explain why that is.