from flask import Flask,render_template,flash,get_flashed_messages app = Flask(__name__) app.secret_key=("21h3i2o1") @app.route('/x1') def index1(): flash(username) print(get_flashed_messages()) # 只会出现一次 马上就会显示 return index1 @app.route(/x2 index2(): print(get_flashed_messages()) index2" if __name__ == __main__: app.run(debug=True)
原文链接:/flask/882522.html