本文整理汇总了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