I think you have your answer there in the post you've given.
You need to define custom JSON renderer
from rest_framework.renderers import JSONRenderer
class EmberJSONRenderer(JSONRenderer):
def render(self, data, accepted_media_type=None, renderer_context=None):
data = {'element': data}
return super(EmberJSONRenderer, self).render(data, accepted_media_type, renderer_context)
and use it as default renderer either in settings or as an explicitly defined render for you view, like:
class MyView(APIView):
renderer_classes = (EmberJSONRenderer, )
# ...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…