Answer the question
In order to leave comments, you need to log in
How to connect SQLAlchemy to Flask?
I seem to be doing everything right, but an error occurs:
C:\Main\lib\site-packages\flask_sqlalchemy\__init__.py:852: 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. '
C:\Main\lib\site-packages\flask_sqlalchemy\__init__.py:873: 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.
'SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and '
app = Flask(__name__)
app.config['SQLALCHEMY DATABASE_URI'] = 'sqlite:///myBase.db'
app.config['SQLALCHEMY TRACK_MODIFICATIONS'] = False
db = SQLAlchemy(app)
with app.app_context():
db.create_all()
Answer the question
In order to leave comments, you need to log in
This is not an error, but a warning. They crash because the configuration parameters are written incorrectly.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question