Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update renderers documentation example #9362

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/api-guide/renderers.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ By default this will include the following keys: `view`, `request`, `response`,

The following is an example plaintext renderer that will return a response with the `data` parameter as the content of the response.

from django.utils.encoding import smart_text
from django.utils.encoding import smart_str
from rest_framework import renderers


Expand All @@ -292,7 +292,7 @@ The following is an example plaintext renderer that will return a response with
format = 'txt'

def render(self, data, accepted_media_type=None, renderer_context=None):
return smart_text(data, encoding=self.charset)
return smart_str(data, encoding=self.charset)

## Setting the character set

Expand Down
Loading