You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
499 B

from flask import Flask,render_template,request,redirect
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql://root:root@127.0.0.1:3306/test'
db = SQLAlchemy(app)
@app.route("/select_all")
def select_all():
jijinhui_list = jijinhui.query.all() # 拿到数据库的数据
return render_template("lkk.html",jijinhui_list=jijinhui_list)
@app.route("/")
def index():
return select_all()
if __name__ == '__main__':
app.run()