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.4.tar.gz
(132.2 kB
view hashes)
Built Distribution
Close
Hashes for Flask_SQLAlchemy-2.4.4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05b31d2034dd3f2a685cbbae4cfc4ed906b2a733cff7964ada450fd5e462b84e |
|
MD5 | 07b1bd02646a670366394301df0082cb |
|
BLAKE2b-256 | af4b3dd83c3e2c6e3034b804d971952e0120606506f153990cc56d2d33173b72 |