You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
![]() |
20 hours ago | |
---|---|---|
.github | 20 hours ago | |
artwork | 12 years ago | |
docs | 1 year ago | |
examples | 1 year ago | |
requirements | 21 hours ago | |
src/flask_sqlalchemy | 10 months ago | |
tests | 1 year ago | |
.editorconfig | 2 years ago | |
.gitignore | 10 months ago | |
.pre-commit-config.yaml | 21 hours ago | |
.readthedocs.yaml | 1 year ago | |
CHANGES.rst | 20 hours ago | |
CODE_OF_CONDUCT.md | 3 years ago | |
CONTRIBUTING.rst | 2 years ago | |
LICENSE.rst | 3 years ago | |
MANIFEST.in | 2 years ago | |
README.rst | 1 year ago | |
setup.cfg | 1 year ago | |
setup.py | 1 year ago | |
tox.ini | 20 hours ago |
README.rst
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
= Flask(__name__)
app "SQLALCHEMY_DATABASE_URI"] = "sqlite:///example.sqlite"
app.config[= SQLAlchemy(app)
db
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
= db.Column(db.String, unique=True, nullable=False)
username = db.Column(db.String, unique=True, nullable=False)
email
="Flask", email="example@example.com"))
db.session.add(User(username
db.session.commit()
= User.query.all() users
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
- Documentation: https://flask-sqlalchemy.palletsprojects.com/
- Changes: https://flask-sqlalchemy.palletsprojects.com/changes/
- PyPI Releases: https://pypi.org/project/Flask-SQLAlchemy/
- Source Code: https://github.com/pallets/flask-sqlalchemy/
- Issue Tracker: https://github.com/pallets/flask-sqlalchemy/issues/
- Website: https://palletsprojects.com/
- Twitter: https://twitter.com/PalletsTeam
- Chat: https://discord.gg/pallets