-
Notifications
You must be signed in to change notification settings - Fork 4
Home
pkirlin edited this page Oct 10, 2016
·
31 revisions
In this first application, we will make sure Flask is working correctly.
- Make a new folder somewhere to hold all your Flask applications. Call it something like
flask-apps. - In that folder, make a sub-folder called
first. - Start up Spyder and create a new file called
app.py. - Inside this file, put the following code:
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello, World!'- Let's go through this line by line.
- Line 1: This imports the flask package.
- Line 2: This makes a new flask application and puts it into the
appvariable.
Use the main wiki page to navigate, not the list of pages directly above, because those are out of order.