Created
December 12, 2016 15:29
-
-
Save c-rhodes/783ca6faf2311deb99968854085794e5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from rest_framework import renderers | |
| class PlainTextRenderer(renderers.BaseRenderer): | |
| media_type = 'text/plain' | |
| format = 'text' | |
| def render(self, data, media_type=None, renderer_context=None): | |
| return str(renderers.JSONRenderer().render(data, media_type, renderer_context)).encode(self.charset) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment