@app.route(’/user/<username>’) @app.route(’/post/<int:post_id>’) @app.route(’/post/<float:post_id>’) @app.route(’/post/<path:path>’) @app.route(’/logi Read More
posted @ 2020-12-01 23:33 暗夜精灵123 Views(70) Comments(0) Diggs(0) Edit
from flask import Flask, url_forapp = Flask(__name__)endpoint:用来给url起别名,通过url_for来反向生成url,如果不写则默认是函数名@app.route('/index', methods=['GET', 'POST'], end Read More
posted @ 2020-12-01 23:32 暗夜精灵123 Views(103) Comments(0) Diggs(0) Edit
方式一:字段赋值方式导入 1 2 3 4 5 6 7 8 9 10 11 12 13 14 from flask import Flask app = Flask(__name__) app.config["debug"] = True app.secret_key = 'afadfadfaf' @ Read More
posted @ 2020-12-01 23:29 暗夜精灵123 Views(158) Comments(0) Diggs(0) Edit