Every time I run my app that uses Flask-SQLAlchemy I get the following warning that the SQLALCHEMY_TRACK_MODIFICATIONS option will be disabled.
Jeff Widman's detailed explanation is simply perfect.
Since I had some copy'n'paste fights before getting this right I'd like to make it easier for the next one that will be in my shoes.
In your code, immediately after:
app = Flask(__name__)
If you want to enable track modifications simply add:
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True
Otherwise, if you are not using this feature, you may want to change the value to False in order not to waste system resources. This will still silence the warning since you're anyway explicitly setting the config.
Here's the same snippet with False value:
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
Thanks to Jeff Widman for this added suggestion and details.