Exemplo n.º 1
1
def create_app(config=None):
    """Create an instance of the tentd flask application"""
    app = Flask("tentd")
    app.add_url_rule("/", "home", description)
    app.request_class = Request

    # Load the default configuration values
    import tentd.defaults as defaults

    app.config.from_object(defaults)

    # Load the user configuration values
    if isinstance(config, basestring):
        config = make_config(config)

    if not isinstance(config, dict):
        raise TypeError("Config argument must be a dict or string.")

    if config is not None:
        app.config.update(config)

    # Initialise the db for this app
    db.init_app(app)

    # Register the entity blueprints
    for blueprint in (entity, followers, posts):
        app.register_blueprint(blueprint, url_prefix=blueprint.prefix(app))

    return app
Exemplo n.º 2
0
def create_app(config=None):
    """Create an instance of the tentd flask application"""
    app = Flask('tentd')
    app.add_url_rule('/', 'home', description)
    app.request_class = Request
    
    # Load the default configuration values
    import tentd.defaults as defaults
    app.config.from_object(defaults)

    # Load the user configuration values
    if isinstance(config, basestring):
        config = make_config(config)

    if not isinstance(config, dict):
        raise TypeError("Config argument must be a dict or string.")
        
    if config is not None:
        app.config.update(config)

    # Initialise the db for this app
    db.init_app(app)

    # Register the entity blueprints
    for blueprint in (entity, followers, posts):
        app.register_blueprint(blueprint, url_prefix=blueprint.prefix(app))

    return app
Exemplo n.º 3
0
def create_app(config=dict()):
    """Create an instance of the tentd flask application"""
    app = Flask('tentd')
    app.add_url_rule('/', 'home', description)
    
    # Load configuration
    import tentd.defaults as defaults
    app.config.from_object(defaults)
    app.config.update(config)

    # Initialise the db for this app
    db.init_app(app)

    # Register the blueprints
    app.register_blueprint(entity)

    return app
Exemplo n.º 4
0
def create_app(config=dict()):
    """Create an instance of the tentd flask application"""
    app = Flask('tentd')
    app.add_url_rule('/', 'home', description)

    # Load configuration
    import tentd.defaults as defaults
    app.config.from_object(defaults)
    app.config.update(config)

    # Initialise the db for this app
    db.init_app(app)

    # Register the blueprints
    app.register_blueprint(entity)

    return app