Exemple #1
0
def init_app(flask_app):
    configure(flask_app)

    blueprint = Blueprint('/', __name__)
    api.init_app(blueprint)
    api.add_namespace(ns)
    flask_app.register_blueprint(blueprint)
Exemple #2
0
def initialize_app(flask_app):
    configure_app(flask_app)

    blueprint = Blueprint('api', __name__, url_prefix='/api')
    api.init_app(blueprint)
    api.add_namespace(trans_namespace)
    flask_app.register_blueprint(blueprint)
def initialize_app(flask_app):
    configure_app(flask_app)
    blueprint = Blueprint('api', __name__, url_prefix='/api')
    api.init_app(blueprint)
    api.add_namespace(ns_frame_prints)
    # api.add_namespace(blog_categories_namespace)
    flask_app.register_blueprint(blueprint)
Exemple #4
0
def initialize_app(flask_app):
    configure_app(flask_app)

    blueprint = Blueprint('api_', __name__, url_prefix=ROOT)
    api.init_app(blueprint)
    api.add_namespace(health_namespace)
    flask_app.register_blueprint(blueprint)
Exemple #5
0
def initializer_app(flask_app):
	configure_app(app)
	chatbotapi = Blueprint('chatbotapi',__name__,url_prefix='/api')
	api.init_app(chatbotapi)
	api.add_namespace(chatbot_namespace)
	flask_app.register_blueprint(chatbotapi)
	flask_app.register_blueprint(chatbot)
Exemple #6
0
def initialize_app(flask_app):
    configure_app(flask_app)

    blueprint = Blueprint('api', __name__, url_prefix='/api')
    api.init_app(blueprint)
    api.add_namespace(status_namespace)
    flask_app.register_blueprint(blueprint)
Exemple #7
0
def create_app():
    # Initialize and configure flask app
    app = Flask(__name__, static_folder='../frontend/opencv-app/dist/')
    app.config.update(config)

    # Initilize database and migrations
    db.init_app(app)
    Migrate(app, db)

    # Register API endpoints (blueprints)
    blueprint = Blueprint('api', __name__, url_prefix='/api')
    api.init_app(blueprint)
    api.add_namespace(user_namespace)
    api.add_namespace(photo_namespace)
    api.add_namespace(ta_namespace)
    app.register_blueprint(blueprint)

    # Initialize JWT module
    JWTManager(app)

    # Send frontend page
    @app.route('/')
    def index_client():
        entry = os.path.join('../frontend/opencv-app/dist', 'index.html')
        return send_file(entry)

    return app
Exemple #8
0
def initialize(app):
    blueprint = Blueprint('api', __name__, url_prefix='/api')
    api.init_app(blueprint)
    api.add_namespace(anomaly_namespace)
    api.add_namespace(status_namespace)
    api.add_namespace(modus_namespace)
    api.add_namespace(timeplan_namespace)
    app.register_blueprint(blueprint)
Exemple #9
0
def initialize_app(flask_app):
    flask_app.config['SERVER_NAME'] = "165.22.121.233:8888"
    flask_app.config['RESTPLUS_VALIDATE'] = True
    blueprint = Blueprint('api', __name__, url_prefix='/api')
    api.init_app(blueprint)
    api.add_namespace(authorization_namespace)
    api.add_namespace(dashboard_namespace)
    flask_app.register_blueprint(blueprint)
Exemple #10
0
def initialize_app(flask_app):
    configure_app(flask_app)

    blueprint = Blueprint('api', __name__, url_prefix='/api')
    api.init_app(blueprint)
    api.add_namespace(linear_reg_training_namespace)
    api.add_namespace(linear_reg_prediction_namespace)
    flask_app.register_blueprint(blueprint)
def initialize_app(app):
    app.config['RESTPLUS_VALIDATE'] = True
    app.config['ERROR_404_HELP'] = False

    blueprint = Blueprint('api', __name__)
    api.init_app(blueprint)
    app.register_blueprint(blueprint)

    api.add_namespace(race_res)
def initialize_app(flask_app):
    blueprint = Blueprint('geolocation', __name__, url_prefix='/geolocation')
    api.init_app(blueprint)
    api.add_namespace(location_namespace)
    flask_app.register_blueprint(blueprint)

    db.init_app(flask_app)

    from database import create_database
    create_database(app=flask_app)
Exemple #13
0
def init_app(flask_app):
    app.config['DATABASE'] = 'events'

    blueprint = Blueprint('api', __name__, url_prefix='/api')
    api.init_app(blueprint)
    api.add_namespace(events_namespace)
    api.add_namespace(clubs_namespace)
    api.add_namespace(circuits_namespace)
    api.add_namespace(categories_namespace)
    flask_app.register_blueprint(blueprint)
Exemple #14
0
def initialize_app(flask_app):
    configure_app(flask_app)

    blueprint = Blueprint('api', __name__, url_prefix='/api')
    api.init_app(blueprint)
    api.add_namespace(filings_namespace)
    api.add_namespace(search_results_namespace)
    flask_app.register_blueprint(blueprint)

    db.init_app(flask_app)
Exemple #15
0
def initialize_app(flask_app):
    blueprint = Blueprint('weather', __name__, url_prefix='/weather')
    api.init_app(blueprint)
    api.add_namespace(protected_namespace)
    api.add_namespace(public_namespace)
    flask_app.register_blueprint(blueprint)

    db.init_app(flask_app)

    from database import create_database
    create_database(app=flask_app)
Exemple #16
0
def initialize_app(flask_app):
    configure_app(flask_app)

    blueprint = Blueprint('api', __name__, url_prefix='/api')
    api.init_app(blueprint)
    api.add_namespace(some_entity_namespace)
    api.add_namespace(another_entity_namespace)
    api.add_namespace(third_entity_namespace)
    flask_app.register_blueprint(blueprint)

    db.init_app(flask_app)
Exemple #17
0
def initialize_app(flask_app):
    configure_app(flask_app)

    blueprint = Blueprint('api', __name__, url_prefix='/api/v1.0')
    api.init_app(blueprint)
    api.add_namespace(movies_namespace)
    api.add_namespace(planets_namespace)
    flask_app.register_blueprint(blueprint)

    db.init_app(flask_app)
    with flask_app.app_context():
        db.create_all()
Exemple #18
0
def initialize_app(flask_app):
    '''
    Initialize Flask application with Flask-RestPlus

    :param flask_app: instance of Flask() class
    '''
    blueprint = Blueprint('poc_api', __name__, url_prefix='/poc_api')

    configure_app(flask_app)
    api.init_app(blueprint)
    api.add_namespace(ocr_client_namespace)

    flask_app.register_blueprint(blueprint)
def initialize_app(flask_app, server_name, server_port):
    '''
    Initialize Flask application with Flask-RestPlus

    :param flask_app: instance of Flask() class
    '''
    blueprint = Blueprint('tf_api', __name__, url_prefix='/tf_api')

    configure_app(flask_app, server_name, server_port)
    api.init_app(blueprint)
    api.add_namespace(species_client_namespace)

    flask_app.register_blueprint(blueprint)
Exemple #20
0
def initialize_app(flask_app):
    configure_app(flask_app)

    blueprint = Blueprint('api', __name__, url_prefix='/api')
    api.init_app(blueprint)
    api.add_namespace(event_namespace)
    api.add_namespace(user_namespace)
    api.add_namespace(auth_namespace)
    api.add_namespace(comment_namespace)
    api.add_namespace(report_namespace)
    flask_app.register_blueprint(blueprint)

    db.init_app(flask_app)
def initialize_app(flask_app, server_name, server_port):
    '''
    Initialize Flask application with Flask-RestPlus

    :param flask_app: instance of Flask() class
    '''
    blueprint = Blueprint('tf_api', __name__, url_prefix='/tf_api')

    configure_app(flask_app, server_name, server_port)
    api.init_app(blueprint)
    api.add_namespace(gan_client_namespace)

    flask_app.register_blueprint(blueprint)
Exemple #22
0
def create_app():
    flask_app = Flask(__name__)

    configure_app(flask_app)

    blueprint = Blueprint('api', __name__, url_prefix='/api')

    api.init_app(blueprint)
    api.add_namespace(deployments_namespace)
    flask_app.register_blueprint(blueprint)

    EventsView.register(flask_app)

    return flask_app
Exemple #23
0
def init(flask_app):
    configure_app(flask_app)

    blueprint = Blueprint('api', __name__, url_prefix='/api')
    api.init_app(blueprint)
    api.namespaces.clear()
    api.add_namespace(doc_dataset_namespace)
    api.add_namespace(doc_trace_namespace)

    flask_app.register_blueprint(blueprint)

    with flask_app.app_context():
        db.init_app(flask_app)
        db.create_all()
Exemple #24
0
def create_app(config_name):
    app = Flask(__name__, instance_relative_config=True)
    app.config.from_object(app_config[config_name])
    app.config.from_pyfile('config.py')
    app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False

    api_blueprint = Blueprint('api', __name__, url_prefix='/api/v1')
    api.init_app(api_blueprint)
    api.add_namespace(bucketlists_namespace)
    api.add_namespace(auth_namespace)
    app.register_blueprint(api_blueprint)

    db.init_app(app)
    return app
def initialize_app(flask_app, config='settings', override={}):
    logger.info("Initializing the application.")
    configure_app(flask_app, config=config)

    # Check if any external override in config to be applied.
    if override:
        flask_app.config.update(override)

    admin = Admin(flask_app, name='Employee Attendance', template_mode='bootstrap3', url='/himama/home')
    admin.add_view(AdminUserView(ApplicationUser, db.session, 'Teachers'))
    admin.add_view(SpellView(Spell, db.session, 'Clock Timings'))

    # Register admin panel.
    admin_blueprint = Blueprint('admin_api', __name__, url_prefix='/himama')
    api.init_app(admin_blueprint)
    api.add_namespace(admin_panel_namespace)
    flask_app.register_blueprint(admin_blueprint)

    clock_blueprint = Blueprint('clock_api', __name__, url_prefix='/himama')
    api.init_app(clock_blueprint)
    api.add_namespace(clock_namespace)
    # # Register the API blueprint.blueprint
    flask_app.register_blueprint(clock_blueprint)

    # Initialize db and app.
    db.init_app(flask_app)

    # Registering login manager.
    login = LoginManager()
    login.init_app(flask_app)



    # Remember the current user
    @flask_app.before_request
    def before_request():
        g.user = current_user

    @login.user_loader
    def load_user(user_id):
        return ApplicationUser.query.get(user_id)
    # Path set according to the current repo.
    migration_path = 'migrations'

    # Flask Migration.
    Migrate(flask_app, db, directory=migration_path)

    return flask_app
Exemple #26
0
def initialize_app(flask_app):
    configure_app(flask_app)

    blueprint = Blueprint('api', __name__, url_prefix='/api')
    api.init_app(blueprint)
    api.add_namespace(cmr_collections_namespace)
    api.add_namespace(algorithm_namespace)
    api.add_namespace(job_namespace)
    api.add_namespace(wmts_namespace)
    api.add_namespace(wms_namespace)
    api.add_namespace(members_namespace)
    api.add_namespace(query_service_namespace)
    api.add_namespace(three_d_tiles_namespace)
    api.add_namespace(environment_namespace)
    api.add_namespace(ogcapi_features_namespace)
    flask_app.register_blueprint(blueprint)
Exemple #27
0
def init_app(flask_app):
    flask_app.config.update(
        dict(DATABASE=DB_CONFIG.content['db_sqlite_relative'], ))
    flask_app.config.from_envvar('FALSKR_SETTINGS', silent=True)

    global ver
    api.version = ver.settings['version']
    ver.settings['database'].init(flask_app.config['DATABASE'])

    blueprint = Blueprint('api',
                          __name__,
                          url_prefix='/api' + ver.settings['url'])
    CORS(blueprint)
    for ns in ver.settings['namespaces']:
        api.add_namespace(ns)
    api.init_app(blueprint)
    flask_app.register_blueprint(blueprint)
Exemple #28
0
def initialize_app(flask_app):
    flask_app.config.from_object('config.DefaultConfig')
    blueprint = Blueprint('api', __name__, url_prefix='/api')
    api.init_app(blueprint)
    api.add_namespace(plant_namespace)
    api.add_namespace(text_namespace)
    api.add_namespace(type_namespace)
    api.add_namespace(image_namespace)
    api.add_namespace(user_namespace)
    api.add_namespace(disease_namespace)
    api.add_namespace(logger_namespace)
    api.add_namespace(token_namespace)
    api.add_namespace(analysis_namespace)
    api.add_namespace(analysisResult_namespace)
    api.add_namespace(message_namespace)
    api.add_namespace(classifier_namespace)
    flask_app.register_blueprint(blueprint)
    return flask_app
Exemple #29
0
def initialize_app(flask_app):
    """
    Initialize Flask
    :param flask_app: the flask application
    :return: the same flask application, initialized
    """
    configure_app(flask_app)
    db = dynamo.dynamo_conn
    db.init_db(flask_app.config['DB_URL'], flask_app.config['TABLE_NAME'],
               'us-west-1')
    deployed.init_protocol(settings.RPC_PATH, settings.DATATRUST_CONTRACT,
                           settings.DATATRUST_HOST, settings.VOTING_CONTRACT,
                           settings.DATATRUST_KEY, settings.DATATRUST_WALLET)
    deployed.initialize_datatrust()

    blueprint = Blueprint('api', __name__, url_prefix='/api')
    api.init_app(blueprint)
    api.add_namespace(health_namespace)
    api.add_namespace(listings_namespace)
    flask_app.register_blueprint(blueprint)
Exemple #30
0
def initialize_app(flask_app):
    configure_app(flask_app)

    blueprint = Blueprint('api', __name__, url_prefix='/api')
    api.init_app(blueprint)
    api.add_namespace(service_namespace)
    api.add_namespace(user_profile_namespace)
    api.add_namespace(domain_profile_namespace)
    api.add_namespace(implicit_profile_namespace)
    api.add_namespace(gbu_namespace)
    api.add_namespace(vul_record_namespace)
    api.add_namespace(vulnerabilities_namespace)
    api.add_namespace(oracle_severity_score_namespace)
    flask_app.register_blueprint(blueprint)

    with flask_app.test_request_context():
        db.init_app(app)
        db.drop_all()
        db.create_all()
        db_seed()
Exemple #31
0
def initialize_app(flask_app):
    configure_app(flask_app)

    blueprint = Blueprint('api', __name__, url_prefix='/pyapi')
    api.init_app(blueprint)
    api.add_namespace(jenkins_job_namespace)
    api.add_namespace(health_namespace)
    flask_app.register_blueprint(blueprint)

    custom_apidoc = apidoc.Apidoc(
        'restplus_custom_doc',
        __name__,
        template_folder='templates',
        static_folder=os.path.dirname(apidoc.__file__) + '/static',
        static_url_path='/')

    @custom_apidoc.add_app_template_global
    def swagger_static(filename):
        return url_for('restplus_custom_doc.static', filename=filename)

    flask_app.register_blueprint(custom_apidoc, url_prefix='/pyapi/ui')
Exemple #32
0
def initialize_app(flask_app):
    # configure_app(flask_app)
    blueprint = Blueprint('api', __name__, url_prefix='/api')
    api.init_app(blueprint)
    api.add_namespace(users_namespace)
    api.add_namespace(evaluator_namespace)
    api.add_namespace(courses_namespace)
    api.add_namespace(groups_namespace)
    api.add_namespace(topics_namespace)
    api.add_namespace(languages_namespace)
    api.add_namespace(submissions_namespace)
    api.add_namespace(problems_namespace)
    api.add_namespace(assignments_namespace)
    api.add_namespace(team_namespace)
    api.add_namespace(statistics_namespace)
    api.add_namespace(forum_namespace)
    api.add_namespace(comment_namespace)
    api.add_namespace(messages_namespace)
    api.add_namespace(recomendation_namespace)
    flask_app.register_blueprint(blueprint)
    socketio.on_namespace(chat.ChatNamespace('/chat'))
    socketio.on_namespace(contest.ContestNamespace('/contest'))