diff --git a/requirements.txt b/requirements.txt index 0b41cd50b..892a02300 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,3 +11,5 @@ -r requirements/requirements-documentation.txt -r requirements/requirements-codestyle.txt -r requirements/requirements-packaging.txt + +ujson==2.0.3 diff --git a/rest_framework/renderers.py b/rest_framework/renderers.py index f043e6327..7bf8627b2 100644 --- a/rest_framework/renderers.py +++ b/rest_framework/renderers.py @@ -102,7 +102,7 @@ class JSONRenderer(BaseRenderer): separators = INDENT_SEPARATORS ret = json.dumps( - data, cls=self.encoder_class, + data, indent=indent, ensure_ascii=self.ensure_ascii, allow_nan=not self.strict, separators=separators ) diff --git a/rest_framework/utils/json.py b/rest_framework/utils/json.py index cb5572380..4fc87bd73 100644 --- a/rest_framework/utils/json.py +++ b/rest_framework/utils/json.py @@ -9,7 +9,7 @@ handled by users at the renderer and parser layer. from __future__ import absolute_import import functools -import json # noqa +import ujson as json # noqa def strict_constant(o):