本文整理汇总了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
示例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
示例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
示例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
示例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)
示例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)
示例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')