Menu Close

How to fix Python Flask Value error view function did not return a response?

Sometimes, we want to fix Python Flask Value error view function did not return a response.

In this article, we’ll look at how to fix Python Flask Value error view function did not return a response.

How to fix Python Flask Value error view function did not return a response?

To fix Python Flask Value error view function did not return a response, we should return a response in our view.

For instance, we write

@app.route('/')
def my_form():
    return render_template("my-form.html")

to call render_template with the template file name to return the template with the given file name as the response.

Conclusion

To fix Python Flask Value error view function did not return a response, we should return a response in our view.

Posted in Python, Python Answers