0

I try to run this code:

 from flask import Flask

app = Flask(__name__)

@app.route('/')
def index():
    return 'hello world'

but you don't get the url in terminal this is what is shown:

PS C:\Users\acer\Tpython> & C:/Users/acer/AppData/Local/Programs/Python/Python38-32/python.exe c:/Users/acer/Tpython/flaskp.py
PS C:\Users\acer\Tpython> 

So how do I figure out the url that flask is running on.

Brody Critchlow
  • 45
  • 3
  • 21
ghada
  • 3
  • 1

1 Answers1

1

Flask runs off of your machine (LOCAL Host) Meaning that when you run the python code. It goes to 127.0.0.1:PORT, if you didn't define a new port, then you should be able to go to 127.0.0.1:5000 and it should show you your flask website. If you already have something running on that page most likely it wont show up. So change the port of the flask app.

Other flask links

Brody Critchlow
  • 45
  • 3
  • 21