Skip to content

Commit

Permalink
Explicitly disable SQLALCHEMY_TRACK_MODIFICATIONS
Browse files Browse the repository at this point in the history
This silences deprecation warnings.
Background: https://stackoverflow.com/a/33790196/770425

Note: This code can be removed once `flask_sqlalchemy` 3.0 ships, or any
release that includes
pallets-eco/flask-sqlalchemy#727.
  • Loading branch information
jeffwidman committed Feb 18, 2020
1 parent 88f15cb commit 9c7db48
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions example/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
#app.config['DEBUG_TB_HOSTS'] = ('127.0.0.1', '::1' )
app.config['SECRET_KEY'] = 'asd'
app.config['DEBUG'] = True

# TODO: This can be removed once flask_sqlalchemy 3.0 ships
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False

app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db'
db = SQLAlchemy(app)

Expand Down
3 changes: 3 additions & 0 deletions test/basic_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
app.debug = True
app.config['SECRET_KEY'] = 'abc123'

# TODO: This can be removed once flask_sqlalchemy 3.0 ships
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False

# make sure these are printable in the config panel
app.config['BYTES_VALUE'] = b'\x00'
app.config['UNICODE_VALUE'] = u'\uffff'
Expand Down

0 comments on commit 9c7db48

Please sign in to comment.