<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          flask-sqlalchemyAdds SQLAlchemy support to Flask

          聯(lián)合創(chuàng)作 · 2023-09-20 23:12

          Flask-SQLAlchemy

          Flask-SQLAlchemy is an extension for Flask that adds support for SQLAlchemy to your application. It aims to simplify using SQLAlchemy with Flask by providing useful defaults and extra helpers that make it easier to accomplish common tasks.

          Installing

          Install and update using pip:

          $ pip install -U Flask-SQLAlchemy
          

          A Simple Example

          from flask import Flask
          from flask_sqlalchemy import SQLAlchemy
          
          app = Flask(__name__)
          app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///example.sqlite"
          db = SQLAlchemy(app)
          
          
          class User(db.Model):
              id = db.Column(db.Integer, primary_key=True)
              username = db.Column(db.String, unique=True, nullable=False)
              email = db.Column(db.String, unique=True, nullable=False)
          
          
          db.session.add(User(username="Flask", email="[email protected]"))
          db.session.commit()
          
          users = User.query.all()

          Contributing

          For guidance on setting up a development environment and how to make a contribution to Flask-SQLAlchemy, see the contributing guidelines.

          Donate

          The Pallets organization develops and supports Flask-SQLAlchemy and other popular packages. In order to grow the community of contributors and users, and allow the maintainers to devote more time to the projects, please donate today.

          Links

          瀏覽 14
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  永久网站av漫画 曰韩人妻一区二区 | Cao在线综合 | 国产69精品久久久久久久久久 | 色香蕉在线观看 | 三级片麻豆91 |