Skip to content

Commit ae15876

Browse files
scotchkadavidism
authored andcommitted
warn user when SQLALCHEMY_DATABASE_URI is not set
1 parent 6c1f4a2 commit ae15876

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

flask_sqlalchemy/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,9 @@ def init_app(self, app):
805805
of an application not initialized that way or connections will
806806
leak.
807807
"""
808+
if app.config.get('SQLALCHEMY_DATABASE_URI') is None:
809+
warnings.warn(UserWarning('SQLALCHEMY_DATABASE_URI not set. Defaulting to sqlite.'))
810+
808811
app.config.setdefault('SQLALCHEMY_DATABASE_URI', 'sqlite://')
809812
app.config.setdefault('SQLALCHEMY_BINDS', None)
810813
app.config.setdefault('SQLALCHEMY_NATIVE_UNICODE', None)

0 commit comments

Comments
 (0)