1from flask import Flask
2
3app = Flask(__name__)
4
5@app.route('/')
6def index():
7 return "Hello world!" #if you want to render a .html file,
8 # import render_template from flask and use
9 #render_template("index.html") here.
10
11if __name__ == '__main__':
12 app.debug = True
13 app.run() #go to http://localhost:5000/ to view the page.
1from flask import Flask
2
3app = Flask(__name__)
4
5@app.route("/")
6def hello_world():
7 return "<p>Hello, World!</p>"
8
1$ export FLASK_ENV=development
2$ flask run
3(On Windows you need to use 'set' instead of 'export'.)