SQLALCHEMY进行配置时产生的warning

/home/python/.virtualenvs/py3_flask/lib/python3.5/site-packages/flask_sqlalchemy/__init__.py:774: UserWarning: Neither SQLALCHEMY_DATABASE_URI nor SQLALCHEMY_BINDS is set. Defaulting SQLALCHEMY_DATABASE_URI to "sqlite:///:memory:".
  'Neither SQLALCHEMY_DATABASE_URI nor SQLALCHEMY_BINDS is set. '
/home/python/.virtualenvs/py3_flask/lib/python3.5/site-packages/flask_sqlalchemy/__init__.py:794: FSADeprecationWarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future.  Set it to True or False to suppress this warning.

如果出现这种错误可能是以下两种情况


1. 没有加载配置文件



2. 配置文件位置错误,应在初始化db之前


猜你喜欢

转载自blog.csdn.net/wzx1286474341/article/details/80703150