mysql

作者: xueyueshuai | 来源:发表于2023-12-06 12:25 被阅读0次
    from flask import Flask
    from flask_sqlalchemy import SQLAlchemy
    
    app = Flask(__name__)
    
    user = 'root'
    password = '123456'
    database = 'school'
    uri = 'mysql+pymysql://%s:%s@localhost:3306/%s' % (user, password, database)
    app.config['SQLALCHEMY_DATABASE_URI'] = uri
    app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
    
    db = SQLAlchemy(app)
    
    

    相关文章

      网友评论

          本文标题:mysql

          本文链接:https://www.haomeiwen.com/subject/nejjgdtx.html