Looking for flask Answers? Try Ask4KnowledgeBase
Looking for flask Keywords? Try Ask4Keywords

Flask Hello World


Create hello.py:

from flask import Flask

app = Flask(__name__)

def hello():
    return 'Hello, World!'

Then run it with:

export FLASK_APP=hello.py
flask run
 * Running on http://localhost:5000/

Adding the code below will allow running it directly with python hello.py.

if __name__ == '__main__':