From d09e798dd658e17c5bc9a96b07bd7a3e0ec0a4e1 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Sat, 17 Oct 2015 13:09:58 +0200 Subject: [PATCH] Gives HttpResponse bytes --- umap/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/umap/views.py b/umap/views.py index 17500568..9a634b81 100644 --- a/umap/views.py +++ b/umap/views.py @@ -20,6 +20,7 @@ from django.conf import settings from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.http import HttpResponse, HttpResponseBadRequest from django.utils.translation import ugettext as _ +from django.utils.encoding import smart_bytes from django.core.urlresolvers import reverse from django.core.validators import URLValidator, ValidationError @@ -198,7 +199,7 @@ class MapsShowCase(View): "type": "FeatureCollection", "features": [make(m) for m in maps] } - return HttpResponse(json.dumps(geojson)) + return HttpResponse(smart_bytes(json.dumps(geojson))) showcase = MapsShowCase.as_view()