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

[((108, 123), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (113, 123), False, 'from flask import Flask\n'), ((307, 329), 'src.models.db.init_app', 'db.init_app', (['flask_app'], {}), '(flask_app)\n', (318, 329), False, 'from src.models import db\n'), ((334, 349), 'src.models.db.create_all', 'db.create_all', ([], {}), '()\n', (347, 349), False, 'from src.models import db\n')]