From 63063da0820e23ef0edbf92a3031103a6c2ce254 Mon Sep 17 00:00:00 2001 From: Marcelo Galigniana Date: Thu, 4 Apr 2024 04:12:19 -0300 Subject: [PATCH] Update renderers documentation example (#9362) --- docs/api-guide/renderers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api-guide/renderers.md b/docs/api-guide/renderers.md index 44f1b60218..d48f785ab6 100644 --- a/docs/api-guide/renderers.md +++ b/docs/api-guide/renderers.md @@ -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 @@ -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