Adds SQLAlchemy support to your Flask application.
Project description
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(name="Flask", email="example@example.com"))
db.session.commit()
users = User.query.all()
Links
Documentation: https://flask-sqlalchemy.palletsprojects.com/
Issue tracker: https://github.com/pallets/flask-sqlalchemy/issues
Test status: https://travis-ci.org/pallets/flask-sqlalchemy
Test coverage: https://codecov.io/gh/pallets/flask-sqlalchemy
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Flask-SQLAlchemy-2.4.1.tar.gz
(128.9 kB
view hashes)
Built Distribution
Close
Hashes for Flask_SQLAlchemy-2.4.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0078d8663330dc05a74bc72b3b6ddc441b9a744e2f56fe60af1a5bfc81334327 |
|
MD5 | 68792bc2693ac34782c52346528816a1 |
|
BLAKE2b-256 | 1e65226d95466c75e34e291a76890ed0e27af2e46ab913002847856f11d4d59d |