aboutsummaryrefslogtreecommitdiffstats
path: root/djangorestframework/renderers.py
diff options
context:
space:
mode:
authorTom Christie2011-05-13 09:59:36 +0100
committerTom Christie2011-05-13 09:59:36 +0100
commit8f6bcac7f3f156831343cc7fec79f624dcc2639f (patch)
treeea5017ba47fdbd4410e768c5851a098eed0045d5 /djangorestframework/renderers.py
parent44c8b89c6051483677e72a6fc657b1e0457182d1 (diff)
downloaddjango-rest-framework-8f6bcac7f3f156831343cc7fec79f624dcc2639f.tar.bz2
cleanup
Diffstat (limited to 'djangorestframework/renderers.py')
-rw-r--r--djangorestframework/renderers.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/djangorestframework/renderers.py b/djangorestframework/renderers.py
index e8763f34..371b5ef0 100644
--- a/djangorestframework/renderers.py
+++ b/djangorestframework/renderers.py
@@ -7,6 +7,7 @@ and providing forms and links depending on the allowed methods, renderers and pa
"""
from django import forms
from django.conf import settings
+from django.core.serializers.json import DateTimeAwareJSONEncoder
from django.template import RequestContext, loader
from django.utils import simplejson as json
@@ -81,7 +82,7 @@ class JSONRenderer(BaseRenderer):
except (ValueError, TypeError):
indent = None
- return json.dumps(obj, indent=indent, sort_keys=sort_keys)
+ return json.dumps(obj, cls=DateTimeAwareJSONEncoder, indent=indent, sort_keys=sort_keys)
class XMLRenderer(BaseRenderer):