My Flask code does not run, I dont know how to fix it?

Viewed 26

I have a Udemy course for Python programming language and it teaches about Flask, too. In the video it wrote a code Visual Studio Code like;

from flask import Flask


app = Flask(__name__)

if __name__ == "__main__":
app.run(debug=True)

and opens terminal and writes the name of the file like: directory> python blog.py get a response of

* Restarting with stat
* Debugger is active
* Debugger PIN: 317-890-791
* Running on http://127.0.0.1:5000/ (Press Ctrl +C to quit)

(By the way blog.py is the name of the file) What is the problem with my code or environment? What should I do to fix it?

1 Answers

Are you sure that there is a problem? I don't immediately see one. What do you see in your web browser when you go to http://127.0.0.0:5000/ ? If the browser doesn't display an error, I'd say your flask server is running fine.

Related