Decoupled db from app init
This commit is contained in:
parent
b3a4e6a95f
commit
c22255b2e5
|
@ -5,6 +5,7 @@ app = Flask(__name__)
|
||||||
app.config['SQLALCHEMY_DATABASE_URI'] = "sqlite:///static/db/database.db"
|
app.config['SQLALCHEMY_DATABASE_URI'] = "sqlite:///static/db/database.db"
|
||||||
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
|
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
|
||||||
|
|
||||||
db = SQLAlchemy(app)
|
from core.models import db
|
||||||
|
db.init_app(app)
|
||||||
|
|
||||||
from core import routes
|
from core import routes
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
from core import db
|
from flask_sqlalchemy import SQLAlchemy
|
||||||
|
|
||||||
|
db = SQLAlchemy()
|
||||||
|
|
||||||
|
|
||||||
class Table(db.Model):
|
class Table(db.Model):
|
||||||
|
|
Loading…
Reference in New Issue