connect to database from flask app