标签:开发 baidu 日记 web bad redirect nts fonts code
from flask import Flask,make_response,redirect,abort app = Flask(__name__) @app.route(‘/index1‘) def index1(): return make_response(‘<h1>Bad Request</h1>‘, 400) @app.route(‘/index2‘) def index2(): return ‘<h1>Bad Request</h1>‘, 400 @app.route(‘/index3‘) def index3(): return redirect(‘http://www.baidu.com‘)
@app.route(‘/index4‘) def index4(): return abort(404)
if __name__ == ‘__main__‘: app.run(debug=True)
标签:开发 baidu 日记 web bad redirect nts fonts code
原文地址:http://www.cnblogs.com/xu-jian/p/6629232.html