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/
Releases: https://pypi-hypernode.com/project/Flask-SQLAlchemy/
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
Built Distribution
File details
Details for the file Flask-SQLAlchemy-2.4.2.tar.gz
.
File metadata
- Download URL: Flask-SQLAlchemy-2.4.2.tar.gz
- Upload date:
- Size: 131.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6cd9f71a97ef18ca5ae7d8bd316a32b82814efe7b088096ba68fddfd8a17cbe7 |
|
MD5 | 40a61ea2d6b418fbab26e28329f224a8 |
|
BLAKE2b-256 | 82745132705abfa12b5c47ef8538e22b3ca532767f0a81fc154b08633b742e10 |
File details
Details for the file Flask_SQLAlchemy-2.4.2-py2.py3-none-any.whl
.
File metadata
- Download URL: Flask_SQLAlchemy-2.4.2-py2.py3-none-any.whl
- Upload date:
- Size: 17.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2298f6b874c2a2f1f048eaf21ce5d984e36a04ca849b0ac473050a67c8dae76f |
|
MD5 | ecd9b8969dde743ae6224f0c922ec45f |
|
BLAKE2b-256 | 6aa37b8427bb41aa9348670645932c31811b898684010c51fa8db0a82d56fbdb |