Skip to main content

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()

Project details


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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Flask_SQLAlchemy-2.4.1-py2.py3-none-any.whl (17.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file Flask-SQLAlchemy-2.4.1.tar.gz.

File metadata

  • Download URL: Flask-SQLAlchemy-2.4.1.tar.gz
  • Upload date:
  • Size: 128.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.4

File hashes

Hashes for Flask-SQLAlchemy-2.4.1.tar.gz
Algorithm Hash digest
SHA256 6974785d913666587949f7c2946f7001e4fa2cb2d19f4e69ead02e4b8f50b33d
MD5 1f5781cf3e1a2b1aabda47a5b20d2073
BLAKE2b-256 527a35bacbedafdc652d5198b80eb22eacccae0c97a49740a45da828b05cc37b

See more details on using hashes here.

File details

Details for the file Flask_SQLAlchemy-2.4.1-py2.py3-none-any.whl.

File metadata

  • Download URL: Flask_SQLAlchemy-2.4.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.4

File hashes

Hashes for Flask_SQLAlchemy-2.4.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0078d8663330dc05a74bc72b3b6ddc441b9a744e2f56fe60af1a5bfc81334327
MD5 68792bc2693ac34782c52346528816a1
BLAKE2b-256 1e65226d95466c75e34e291a76890ed0e27af2e46ab913002847856f11d4d59d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page