本文整理匯總了Python中flask.ext.api.FlaskAPI.config['DEFAULT_RENDERERS']方法的典型用法代碼示例。如果您正苦於以下問題:Python FlaskAPI.config['DEFAULT_RENDERERS']方法的具體用法?Python FlaskAPI.config['DEFAULT_RENDERERS']怎麽用?Python FlaskAPI.config['DEFAULT_RENDERERS']使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類flask.ext.api.FlaskAPI
的用法示例。
在下文中一共展示了FlaskAPI.config['DEFAULT_RENDERERS']方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: FlaskAPI
# 需要導入模塊: from flask.ext.api import FlaskAPI [as 別名]
# 或者: from flask.ext.api.FlaskAPI import config['DEFAULT_RENDERERS'] [as 別名]
from omas import meislicer
from omas.exceptions import CannotReadMEIException
from omas.exceptions import BadApiRequest
from omas.exceptions import CannotWriteMEIException
from omas.exceptions import CannotAccessRemoteMEIException
from omas.exceptions import UnknownMEIReadException
from omas.exceptions import UnsupportedEncoding
from flask.ext.cors import CORS
app = FlaskAPI(__name__)
CORS(app)
app.config['DEFAULT_RENDERERS'] = [
'flask.ext.api.renderers.JSONRenderer',
'flask.ext.api.renderers.BrowsableAPIRenderer',
]
app.config['DEFAULT_PARSERS'] = [
'flask.ext.api.parsers.JSONParser',
]
# CONVERTERS
class MeasuresConverter(BaseConverter):
def __init__(self, url_map):
super(MeasuresConverter, self).__init__(url_map)
def to_python(self, value):
exp = r'(?:^((all|((start|end|\d+)(-(start|end|\d+))?))+(,|$))+)'
示例2: FlaskAPI
# 需要導入模塊: from flask.ext.api import FlaskAPI [as 別名]
# 或者: from flask.ext.api.FlaskAPI import config['DEFAULT_RENDERERS'] [as 別名]
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.api import FlaskAPI, status, exceptions
app = FlaskAPI(__name__)
from app import renderers
app.config['DEFAULT_RENDERERS'] = [
'app.renderers.ExtendedJSONRenderer',
'app.renderers.MyBrowsableAPIRenderer'
]
db = SQLAlchemy(app)
from app import api
from app import views, models