Created
August 22, 2017 08:34
-
-
Save kunpengku/ebc14993b9c626cd2e1a5542255e226d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding:utf8 | |
from flask_script import Manager | |
from flask import Flask, render_template | |
from flask import Response, json | |
app = Flask(__name__) | |
def list_jsonify(resp): | |
return Response(json.dumps(resp), mimetype='application/json') | |
@app.route("/user/<name>") | |
def hello_you(name): | |
return render_template('name.html', name=name) | |
@app.route("/list") | |
def hello_list(): | |
a = [1,2,3,4,56,7,8,9] | |
return list_jsonify(a) | |
if __name__ == "__main__": | |
app.debug = True | |
app.run(host='0.0.0.0') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment