Skip to content

Instantly share code, notes, and snippets.

@gjo
Created September 14, 2013 03:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gjo/6558691 to your computer and use it in GitHub Desktop.
Save gjo/6558691 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
# http://flask.pocoo.org/docs/quickstart/#a-minimal-application
# から
# http://flask.pocoo.org/docs/quickstart/#variable-rules
# までを写経していくと
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return 'Index Page'
@app.route('/hello')
def hello():
return 'Hello World'
@app.route('/user/<username>')
def show_user_profile(username):
# show the user profile for that user
return 'User %s' % username
if __name__ == '__main__':
app.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment