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.0.tar.gz (128.6 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.0-py2.py3-none-any.whl (17.3 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: Flask-SQLAlchemy-2.4.0.tar.gz
  • Upload date:
  • Size: 128.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for Flask-SQLAlchemy-2.4.0.tar.gz
Algorithm Hash digest
SHA256 0c9609b0d72871c540a7945ea559c8fdf5455192d2db67219509aed680a3d45a
MD5 01e943d6a8b492c2bc6031c024cd10be
BLAKE2b-256 9b6280a56f9d223f0b89cdcf7d592455375f8c9d73866f337fa85f39f45fe0c5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Flask_SQLAlchemy-2.4.0-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.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for Flask_SQLAlchemy-2.4.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8631bbea987bc3eb0f72b1f691d47bd37ceb795e73b59ab48586d76d75a7c605
MD5 f28e8447ba04d48aa9358d521269bf17
BLAKE2b-256 08ca582442cad71504a1514a2f053006c8bb128844133d6076a4df17117545fa

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