from flask import Flask

from src.models import db
from . import config


def create_app():
    flask_app = Flask(__name__)
    flask_app.config['SQLALCHEMY_DATABASE_URI'] = config.DATABASE_CONNECTION_URI
    flask_app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
    flask_app.app_context().push()
    db.init_app(flask_app)
    db.create_all()
    return flask_app

[((8, 16, 8, 31), 'flask.Flask', 'Flask', ({(8, 22, 8, 30): '__name__'}, {}), '(__name__)', False, 'from flask import Flask\n'), ((12, 4, 12, 26), 'src.models.db.init_app', 'db.init_app', ({(12, 16, 12, 25): 'flask_app'}, {}), '(flask_app)', False, 'from src.models import db\n'), ((13, 4, 13, 19), 'src.models.db.create_all', 'db.create_all', ({}, {}), '()', False, 'from src.models import db\n')]