# Path: matl_online/assets.py

# 
# Path: matl_online/extensions.py

# 
# Path: matl_online/settings.py
# class ProdConfig(Config):
#     """Production configuration."""
# 
#     ENV = 'prod'
#     DEBUG = False
#     ASSETS_DEBUG = False
# 
#     GOOGLE_ANALYTICS_UNIVERSAL_ID = os.environ.get('GOOGLE_ANALYTICS_UNIVERSAL_ID')
# 
#     ROLLBAR_ENV = 'production'


from flask import Flask
from matl_online import public
from matl_online.assets import assets
from matl_online.extensions import db, migrate, socketio, celery, csrf
from matl_online.settings import ProdConfig
"""The app module, containing the app factory function."""



def create_app(config_object=ProdConfig):
    """Application factory for creating flask apps."""
    app = Flask(__name__)
    app.config.from_object(config_object)
    register_extensions(app)
    register_blueprints(app)
    return app


def register_extensions(app):
    """Register Flask extensions."""
    assets.init_app(app)
    db.init_app(app)
    migrate.init_app(app, db)

    # Make sure that the client manager isn't remembered
    socketio.server_options.pop('client_manager', None)
    socketio.init_app(
        app,
        message_queue=app.config.get('SOCKETIO_MESSAGE_QUEUE'),
        cors_allowed_origins=app.config.get('CORS_ALLOWED_ORIGINS'),
    )

    celery.conf.update(app.config)

# Path: matl_online/assets.py

# 
# Path: matl_online/extensions.py

# 
# Path: matl_online/settings.py
# class ProdConfig(Config):
#     """Production configuration."""
# 
#     ENV = 'prod'
#     DEBUG = False
#     ASSETS_DEBUG = False
# 
#     GOOGLE_ANALYTICS_UNIVERSAL_ID = os.environ.get('GOOGLE_ANALYTICS_UNIVERSAL_ID')
# 
#     ROLLBAR_ENV = 'production'


# Path: matl_online/app.py
from flask import Flask
from matl_online import public
from matl_online.assets import assets
from matl_online.extensions import db, migrate, socketio, celery, csrf
from matl_online.settings import ProdConfig

"""The app module, containing the app factory function."""



def create_app(config_object=ProdConfig):
    """Application factory for creating flask apps."""
    app = Flask(__name__)
    app.config.from_object(config_object)
    register_extensions(app)
    register_blueprints(app)
    return app


def register_extensions(app):
    """Register Flask extensions."""
    assets.init_app(app)
    db.init_app(app)
    migrate.init_app(app, db)

    # Make sure that the client manager isn't remembered
    socketio.server_options.pop('client_manager', None)
    socketio.init_app(
        app,
        message_queue=app.config.get('SOCKETIO_MESSAGE_QUEUE'),
        cors_allowed_origins=app.config.get('CORS_ALLOWED_ORIGINS'),
    )

    celery.conf.update(app.config)

    csrf.init_app(app)