app/__init__.py
def create_app(node_id, debug=False, database_url=None):
    """ Create / Configure flask socket application instance.
        
        Args:
            node_id (str) : ID of Grid Node.
            debug (bool) : debug flag.
            test_config (bool) : Mock database environment.
        Returns:
            app : Flask application instance.
    """
    app = Flask(__name__)
    app.debug = debug

    app.config["SECRET_KEY"] = "justasecretkeythatishouldputhere"

    # Enable persistent mode
    # Overwrite syft.object_storage methods to work in a persistent way
    # Persist models / tensors
    if database_url:
        app.config["REDISCLOUD_URL"] = database_url
        from .main.persistence import database, object_storage

        db_instance = database.set_db_instance(database_url)
        object_storage.set_persistent_mode(db_instance)

    from .main import html, ws, hook, local_worker, auth

    # Global socket handler
    sockets = Sockets(app)

    # set_node_id(id)
    local_worker.id = node_id
    hook.local_worker._known_workers[node_id] = local_worker
    local_worker.add_worker(hook.local_worker)

    # Register app blueprints
    app.register_blueprint(html, url_prefix=r"/")
    sockets.register_blueprint(ws, url_prefix=r"/")

    # Set Authentication configs
    app = auth.set_auth_configs(app)

    return app
 Create / Configure flask socket application instance.
        
        Args:
            node_id (str) : ID of Grid Node.
            debug (bool) : debug flag.
            test_config (bool) : Mock database environment.
        Returns:
            app : Flask application instance.
    
Create / Configure flask socket application instance.
Create / Configure flask socket application instance .
def create_app(node_id, debug=False, database_url=None):
    app = Flask(__name__)
    app.debug = debug
    app.config["SECRET_KEY"] = "justasecretkeythatishouldputhere"
    if database_url:
        app.config["REDISCLOUD_URL"] = database_url
        from .main.persistence import database, object_storage
        db_instance = database.set_db_instance(database_url)
        object_storage.set_persistent_mode(db_instance)
    from .main import html, ws, hook, local_worker, auth
    sockets = Sockets(app)
    local_worker.id = node_id
    hook.local_worker._known_workers[node_id] = local_worker
    local_worker.add_worker(hook.local_worker)
    app.register_blueprint(html, url_prefix=r"/")
    sockets.register_blueprint(ws, url_prefix=r"/")
    app = auth.set_auth_configs(app)
    return app
def create_app ( node_id , debug = False , database_url = None ) : app = Flask ( __name__ ) app . debug = debug app . config [ "SECRET_KEY" ] = "justasecretkeythatishouldputhere" if database_url : app . config [ "REDISCLOUD_URL" ] = database_url from . main . persistence import database , object_storage db_instance = database . set_db_instance ( database_url ) object_storage . set_persistent_mode ( db_instance ) from . main import html , ws , hook , local_worker , auth sockets = Sockets ( app ) local_worker . id = node_id hook . local_worker . _known_workers [ node_id ] = local_worker local_worker . add_worker ( hook . local_worker ) app . register_blueprint ( html , url_prefix = r"/" ) sockets . register_blueprint ( ws , url_prefix = r"/" ) app = auth . set_auth_configs ( app ) return app
Create / Configure flask socket application instance.
Create / Configure flask socket application instance .
""" Create / Configure flask socket application instance.
        
        Args:
            node_id (str) : ID of Grid Node.
            debug (bool) : debug flag.
            test_config (bool) : Mock database environment.
        Returns:
            app : Flask application instance.
    """ # Enable persistent mode # Overwrite syft.object_storage methods to work in a persistent way # Persist models / tensors # Global socket handler # set_node_id(id) # Register app blueprints # Set Authentication configs
app : Flask application instance.
app : Flask application instance .
node_id
ID of Grid Node.
ID of Grid Node .
debug
None
database_url
test_config
Mock database environment.
Mock database environment .