当前位置: 首页>>代码示例>>Python>>正文


Python FlaskAPI.register_blueprint方法代码示例

本文整理汇总了Python中flask.ext.api.FlaskAPI.register_blueprint方法的典型用法代码示例。如果您正苦于以下问题:Python FlaskAPI.register_blueprint方法的具体用法?Python FlaskAPI.register_blueprint怎么用?Python FlaskAPI.register_blueprint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在flask.ext.api.FlaskAPI的用法示例。


在下文中一共展示了FlaskAPI.register_blueprint方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: create_manager

# 需要导入模块: from flask.ext.api import FlaskAPI [as 别名]
# 或者: from flask.ext.api.FlaskAPI import register_blueprint [as 别名]
def create_manager(case_api_client=CaseApi):
    app = FlaskAPI(__name__)
    app.config.from_pyfile('config.py')

    manager = Manager(app)
    app.register_blueprint(helloworld.blueprint)
    app.register_blueprint(deed.blueprint(case_api_client()))

    db.init(app, manager)

    return manager
开发者ID:LandRegistry,项目名称:charges-deed-api,代码行数:13,代码来源:__init__.py

示例2: create_app

# 需要导入模块: from flask.ext.api import FlaskAPI [as 别名]
# 或者: from flask.ext.api.FlaskAPI import register_blueprint [as 别名]
def create_app(config_name):
    app = FlaskAPI(__name__)

    app.config.from_object(config[config_name])

    config[config_name].init_app(app)

    db.init_app(app)

    from api.v1 import api as api_blueprint
    app.register_blueprint(api_blueprint, url_prefix='/api/v1')

    return app
开发者ID:andela-ijubril,项目名称:bucketlist-api,代码行数:15,代码来源:__init__.py

示例3: create_manager

# 需要导入模块: from flask.ext.api import FlaskAPI [as 别名]
# 或者: from flask.ext.api.FlaskAPI import register_blueprint [as 别名]
def create_manager():
    app = FlaskAPI(__name__)

    app.config.from_pyfile('config.py')

    app.register_blueprint(helloworld.blueprint)
    app.register_blueprint(home.blueprint)
    app.register_blueprint(case.blueprint)
    app.register_blueprint(borrower.blueprint)
    app.register_blueprint(property.blueprint)
    app.register_blueprint(land_registry.blueprint)

    manager = Manager(app)
    db.init(app, manager)

    return manager
开发者ID:LandRegistry,项目名称:charges-case-api,代码行数:18,代码来源:__init__.py

示例4: create_manager

# 需要导入模块: from flask.ext.api import FlaskAPI [as 别名]
# 或者: from flask.ext.api.FlaskAPI import register_blueprint [as 别名]
def create_manager(deed_api_client=DeedApi):
    app = FlaskAPI(__name__)
    app.config.from_pyfile('config.py')

    app.register_blueprint(helloworld.blueprint)
    app.register_blueprint(key.blueprint)
    app.register_blueprint(sign.blueprint(deed_api_client()))

    manager = Manager(app)
    db.init(app, manager)

    return manager
开发者ID:LandRegistry,项目名称:charges-scribe,代码行数:14,代码来源:__init__.py

示例5: FlaskAPI

# 需要导入模块: from flask.ext.api import FlaskAPI [as 别名]
# 或者: from flask.ext.api.FlaskAPI import register_blueprint [as 别名]
from flask import Flask, url_for
from flask import Flask, render_template, url_for
from werkzeug.routing import Map, Rule, NotFound, RequestRedirect, BaseConverter
from flask.ext.script import Manager
from flask import Flask, jsonify

application = FlaskAPI(__name__)
# manager = Manager(application)

if 'Hacker' in os.environ:
    application.config.from_object(DevelopConfig)
else:
    application.config.from_object(LocalConfig)

# Blueprint
application.register_blueprint(authentication, url_prefix='/authentication')
application.register_blueprint(authors, url_prefix='/authors')
application.register_blueprint(enera, url_prefix='/enera')

# we are going to start mongo whit this application
mongo.init_app(application)


@application.route('/')
def index():
    return {'hola': 'index'}


@application.route('/who/<enerademo>', methods=['GET', 'POST'])
def who(code):
    assert isinstance(code, object)
开发者ID:jarm-mcs,项目名称:pruebam,代码行数:33,代码来源:application.py

示例6: FlaskAPI

# 需要导入模块: from flask.ext.api import FlaskAPI [as 别名]
# 或者: from flask.ext.api.FlaskAPI import register_blueprint [as 别名]
from flask.ext.api import FlaskAPI
import couchdb

server = couchdb.Server()

update = False

try:
    db = server['peleton-db']
except:
    db = server.create('peleton-db')
    update = True

if update:
    db.update([{"_id": "A", "list": [2, 3, 8], "idx": 0}, {"_id": "B", "list": [4, 5, 6], "idx": 0}])
    db.update([{"_id": "merge"}])

app = FlaskAPI(__name__)

from app import routes

from routes import quiz

app.register_blueprint(quiz)
开发者ID:AdrielVelazquez,项目名称:merge_api,代码行数:26,代码来源:__init__.py

示例7: FlaskAPI

# 需要导入模块: from flask.ext.api import FlaskAPI [as 别名]
# 或者: from flask.ext.api.FlaskAPI import register_blueprint [as 别名]
from flask.ext.api import FlaskAPI
from application.main.controllers import main
from application.admin.controllers import admin

app = FlaskAPI(__name__)

app.register_blueprint(main, url_prefix='/')
app.register_blueprint(admin, url_prefix='/admin')
开发者ID:isaquealves,项目名称:flask-api-application-boilerplate,代码行数:10,代码来源:__init__.py


注:本文中的flask.ext.api.FlaskAPI.register_blueprint方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。