diff options
Diffstat (limited to 'wkhtmltopdf/views.py')
-rw-r--r-- | wkhtmltopdf/views.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/wkhtmltopdf/views.py b/wkhtmltopdf/views.py index fff98c8..741742f 100644 --- a/wkhtmltopdf/views.py +++ b/wkhtmltopdf/views.py @@ -7,6 +7,7 @@ import warnings 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 .utils import (content_disposition_filename, override_settings, @@ -86,7 +87,7 @@ class PDFTemplateResponse(TemplateResponse, PDFResponse): # staticfiles app, for instance. with override_settings(**self.get_override_settings()): context = self.resolve_context(self.context_data) - content = template.render(context) + content = smart_str(template.render(context)) tempfile = NamedTemporaryFile(mode=mode, bufsize=bufsize, suffix=suffix, prefix=prefix, |