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.5.0.tar.gz
.
File metadata
- Download URL: Flask-SQLAlchemy-2.5.0.tar.gz
- Upload date:
- Size: 132.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27448f04f46cfb7588ff30a4b7efb08b91d99f80dbee3d884c3cf76fab01cca2 |
|
MD5 | ea2122a33970eec74b6a8c5315681d5c |
|
BLAKE2b-256 | 8cc1a51f224b86d148e5d3434e6b548d7ccef74988e1cfa6cad011e81135fc9a |
File details
Details for the file Flask_SQLAlchemy-2.5.0-py2.py3-none-any.whl
.
File metadata
- Download URL: Flask_SQLAlchemy-2.5.0-py2.py3-none-any.whl
- Upload date:
- Size: 17.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d5153bf451c42880540eea7650300cf0dfec0c16c554f0de5541e78c7cc0443 |
|
MD5 | 56d05c07160914c0839a2097ddbfb2ca |
|
BLAKE2b-256 | 6885fd40f11861d97cbaf4b0369288a293f2017dcea1fd52da2a652b2ceae15a |