Y
Y
Yorik Callil2019-06-15 21:48:19
Python
Yorik Callil, 2019-06-15 21:48:19

Flask's TypeError has been haunting me all day, how do I fix it?

TypeError: The view function did not return a valid response. The function either returned None or ended without a return statement.

(TypeError: The view function does not return a valid response. The function either does not return None or exits without a return statement.)
Haunts all day, sometimes larger projects, now even Hello World!
What's the problem, the reason... What's wrong with this world?! Help me decide!

I work in PyCharm, everything was fine, and now it gives the same error 24/7.
Given the code:
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
if __name__ == "__main__":
app.run()

Where does she come from here!? Why does it appear and what am I doing wrong?!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question