0

I'm trying to run my first flask site, but it just brings up the "This site can't be reached" message. What am I doing wrong? Code:

from flask import Flask
app = Flask(__name__)
@app.route("/")
def welcome():
    return f"<h1>Welcome!</h1>"
if __name__ == "__main__":
    app.run(host='0.0.0.0', port=8080, debug=True)
Ash ESO
  • 13
  • 3

2 Answers2

0

Replace host='0.0.0.0' with your IP Address or you can just remove it.

abhigyanj
  • 2,355
  • 2
  • 9
  • 29
0

Just return localhost for your development needs, even it comes to production it's okay because you could connect the app with Nginx/Apache.

Kiddy
  • 1