SQLAlchemy连接时提示警告:warnings.warn('SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will b

 Pala   2017-07-05 22:06   55 人阅读   条评论

SQLAlchemy连接时提示警告:

E:\software\python35\lib\site-packages\flask_sqlalchemy\__init__.py:800: UserWarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future.  Set it t

o True to suppress this warning.

  warnings.warn('SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future.  Set it to True to suppress this warning.')

这条Warning的大意是:‘SQLALCHEMY_TRACK_MODIFICATIONS’ 这项配置在未来的版本中会被默认为禁止状态,把它设置为True即可取消warning。


在flask Config中,添加这条配置即可:

SQLALCHEMY_TRACK_MODIFICATIONS = True


本文地址:http://chenxm.cc/post/115.html
版权声明:本文为原创文章,版权归 Pala 所有,欢迎分享本文,转载请保留出处!