Skip to content
pkirlin edited this page Oct 10, 2016 · 31 revisions

Your first Flask app

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 app variable.

Use the main wiki page to navigate, not the list of pages directly above, because those are out of order.

Clone this wiki locally