aboutsummaryrefslogtreecommitdiffstats
path: root/wkhtmltopdf/views.py
diff options
context:
space:
mode:
authorMaciek Lenc <mattack108@users.noreply.github.com>2014-09-01 16:39:33 +0100
committerMaciek Lenc <mattack108@users.noreply.github.com>2014-09-01 16:39:33 +0100
commit843f95258563ac75eabb4a79fef216011f320a0a (patch)
tree0a2ce5f2383a960eed733eec1a250c5b7afbb956 /wkhtmltopdf/views.py
parent624e04459d3282141385ff1a67f1c4673cd11f8f (diff)
parent08b50680c71b903634f7137a596ac5c0fe21562f (diff)
downloaddjango-wkhtmltopdf-843f95258563ac75eabb4a79fef216011f320a0a.tar.gz
django-wkhtmltopdf-843f95258563ac75eabb4a79fef216011f320a0a.tar.bz2
django-wkhtmltopdf-843f95258563ac75eabb4a79fef216011f320a0a.zip
Merge pull request #59 from michelts/master
Fix encoding issues in PDFTemplateResponse with python 2.x
Diffstat (limited to 'wkhtmltopdf/views.py')
-rw-r--r--wkhtmltopdf/views.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/wkhtmltopdf/views.py b/wkhtmltopdf/views.py
index 2d91224..d5f189a 100644
--- a/wkhtmltopdf/views.py
+++ b/wkhtmltopdf/views.py
@@ -5,8 +5,8 @@ from tempfile import NamedTemporaryFile
from django.conf import settings
from django.http import HttpResponse
from django.template.response import TemplateResponse
-from django.utils.encoding import smart_str
from django.views.generic import TemplateView
+from django.utils.encoding import smart_text
from .utils import (content_disposition_filename, make_absolute_paths,
wkhtmltopdf)
@@ -72,7 +72,7 @@ class PDFTemplateResponse(TemplateResponse, PDFResponse):
context = self.resolve_context(self.context_data)
- content = smart_str(template.render(context))
+ content = smart_text(template.render(context))
content = make_absolute_paths(content)
try: