Skip to content

Commit

Permalink
Update renderers documentation example (#9362)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgaligniana authored Apr 4, 2024
1 parent 085b7e1 commit 63063da
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 63063da

Please sign in to comment.