from __futre__ import print_function

This commit is contained in:
j 2014-09-30 21:27:26 +02:00
commit ec252440d9
14 changed files with 49 additions and 34 deletions

View file

@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
from __future__ import print_function
import datetime
from django.utils import datetime_safe
from django.http import HttpResponse, Http404
@ -34,7 +35,7 @@ def render_to_json_response(dictionary, content_type="text/json", status=200):
content_type = "text/javascript"
indent = 2
if getattr(settings, 'JSON_DEBUG', False):
print json.dumps(dictionary, indent=2, default=_to_json, ensure_ascii=False).encode('utf-8')
print(json.dumps(dictionary, indent=2, default=_to_json, ensure_ascii=False).encode('utf-8'))
return HttpResponse(json.dumps(dictionary, indent=indent, default=_to_json,
ensure_ascii=False).encode('utf-8'), content_type=content_type, status=status)