Skip to content

Instantly share code, notes, and snippets.

@delikat
Created January 27, 2019 02:01
Show Gist options
  • Save delikat/f34dea70eb89dc5f24674bcc4ead4a26 to your computer and use it in GitHub Desktop.
Save delikat/f34dea70eb89dc5f24674bcc4ead4a26 to your computer and use it in GitHub Desktop.
# database.py
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
# models.py
from database import db
class Request(db.Model):
# ...
# app.py
from flask import Flask
from database import db
app = Flask(__name__)
# do all of your db config
db.init_app(app)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment