Specify encoding for templates in case it's not the default

This commit is contained in:
Ben Sturmfels 2024-03-22 10:10:57 +11:00
parent c52b91e183
commit ffcf016336

View file

@ -48,7 +48,7 @@ def index(request, *args, **kwargs):
pass
# These template are intentionally not in the template loader path, so
# we open them directly, rather than using the template loader.
with open(full_path) as t:
with open(full_path, encoding='utf-8') as t:
template = Template(t.read())
context = RequestContext(request, kwargs)
return HttpResponse(template.render(context))