0 votes
in Python Flask by

In what ways can you connect to a database in Flask?

1 Answer

0 votes
by

Flask works with most of the RDBMSs, such as PostgreSQL, SQLite, and MySQL. However, to connect with databases, we must make use of the Flask-SQLAlchemy extension.

It makes database interaction and management easy during development without the need to write raw SQL queries. Moreover, raw SQL queries are prone to SQL injection attacks. For working with No-SQL data stores such as MongoDB, we can make use of the Flask-MongoEngine extension.

...