Skip to content

Instantly share code, notes, and snippets.

@xiantail
Created December 25, 2015 13:49
Show Gist options
  • Save xiantail/d84063c5c71de933563a to your computer and use it in GitHub Desktop.
Save xiantail/d84063c5c71de933563a to your computer and use it in GitHub Desktop.
Introducing Python / Chapter 9 - Flask
from flask import Flask, render_template, request
app = Flask(__name__, static_folder='.', static_url_path='')
@app.route('/')
def home():
return app.send_static_file('index.html')
@app.route('/echo/')
def echo():
thing = request.args.get('thing')
place = request.args.get('place')
return render_template('flask3.html', thing=thing, place=place)
app.run(port=9999, debug=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment