Ask coding questions

← Back to all posts
Python Flask problem
IcynDevz (765)

Python Flask problem

Here's my code:

from flask import Flask

app = Flask(__name__)

def hello():
  return 'hello!'

if __name__ == "__main__":

I thought when you run this it should have a new tab window and return 'hello'. But when I ran the code, all it did was show 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 (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 172-357-633

And it didn't have a new tab window. Don't judge me please, I'm still a noob at flask. So yeah.

Answered by SixBeeps (5061) [earned 5 cycles]
View Answer
SixBeeps (5061)

Replit requires that you run servers on the host, so replace the call with this:"", debug=True)
ch1ck3n (1625)

can you make the repl public?