Skip to content
Snippets Groups Projects
main.py 665 B
Newer Older
Ethan R Shaw's avatar
Ethan R Shaw committed
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from CS_499_database import conn

db = SQLAlchemy()

def create_app(): 
    app = Flask(__name__)
    app.config['SQLALCHEMY_DATABASE_URI'] = conn
    app.config['SQLALCHEMY_ECHO'] = True
    app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True

    from tempData import tempData_bp
    from powerData import powerData_bp
    from waterData import waterData_bp
    from costData import costData_bp

    app.register_blueprint(tempData_bp)
    app.register_blueprint(powerData_bp)
    app.register_blueprint(waterData_bp)
    app.register_blueprint(costData_bp)

    db.init_app(app=app)

    return app