Skip to content
← Back to Community
My Flask Website won't load
Profile icon
CyberPy

Whenever I run my code, it shows this:

* Serving Flask app 'main' (lazy loading) * Environment: production WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Debug mode: on * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) * Restarting with stat * Debugger is active! * Debugger PIN: 320-939-892

And when I open the website, it shows this:

image

How do I fix?

Answered by VulcanWM [earned 5 cycles]
View Answer
Voters
Profile icon
CyberPy
Comments
hotnewtop
Profile icon
VulcanWM

Try app.run(port=8080, host=‘0.0.0.0’, debug=True)

Profile icon
CyberPy

@VulcanWM
Thanks, it worked!

Profile icon
VulcanWM
Profile icon
CosmicBear

@CodingEssence On Replit you always need to define the host.

Profile icon
VulcanWM
Profile icon
VulcanWM

Can I see the code?

Profile icon
CyberPy

@VulcanWM

from flask import Flask app = Flask(__name__) @app.route("/") def home(): return "Hello, World!" @app.route("/salvador") def salvador(): return "Hello, Salvador" if __name__ == "__main__": app.run(debug=True)