diff options
author | Mart Raudsepp <leio@gentoo.org> | 2016-11-28 12:03:15 +0200 |
---|---|---|
committer | Mart Raudsepp <leio@gentoo.org> | 2016-11-28 12:04:14 +0200 |
commit | 8e8de310d617629fba0887d7760bec6ea54dbf08 (patch) | |
tree | f5f09abb34d7964c55b7ab05f96ecd003ad83766 | |
parent | Make the dummy initial web frontend pretty (diff) | |
download | grumpy-8e8de310d617629fba0887d7760bec6ea54dbf08.tar.gz grumpy-8e8de310d617629fba0887d7760bec6ea54dbf08.tar.bz2 grumpy-8e8de310d617629fba0887d7760bec6ea54dbf08.zip |
Turn off flask-sqlalchemy modification tracking to silence a warning and save resources
We shouldn't need SQLALCHEMY_TRACK_MODIFICATIONS, so just disable it as suggested to
avoid the warning and save these little resources. This is a flask-sqlalchemy specific
session event tracking thing; sqlalchemy itself provides its own mechanism for this
these days, and if we need something like that, we should probably use those, not
this flask-sqlalchemy thing.
-rw-r--r-- | backend/__init__.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/backend/__init__.py b/backend/__init__.py index 46a4007..4d78cd8 100644 --- a/backend/__init__.py +++ b/backend/__init__.py @@ -3,6 +3,7 @@ from flask_sqlalchemy import SQLAlchemy app = Flask("frontend") # FIXME: Finish rearranging frontend/backend modules properly instead of pretending to be frontend in backend/__init__ because jinja templates are looked for from <what_is_passed_here>/templates app.config['SQLALCHEMY_DATABASE_URI'] = "sqlite:///../backend/grumpy.db" # FIXME: configuration support; weird ../ because of claiming we are "frontend" to Flask and want to keep the path the same it was before for now. But this problem should go away with config, at least for postgres :) +app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False db = SQLAlchemy(app) from frontend import * |