From 6bcf70bb8b471e31b18463deb5321bd3a4afcd50 Mon Sep 17 00:00:00 2001 From: Martin Green <martin.speleo@gmail.com> Date: Sat, 18 Jun 2022 23:13:40 +0100 Subject: [PATCH] refactorisation to make debugging easier --- core/views/expo.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/views/expo.py b/core/views/expo.py index d22d516..8ee6101 100644 --- a/core/views/expo.py +++ b/core/views/expo.py @@ -223,7 +223,9 @@ def expopage(request, path): filetobeopened = os.path.normpath(expowebpath / path) try: - return HttpResponse(content=open(unicode(filetobeopened, 'utf8'), "rb"), content_type=getmimetype(path)) + content = open(filetobeopened, "rb" + content_type=getmimetype(path) + return HttpResponse(content = content, content_type=content_type) except IOError: return render(request, 'pagenotfound.html', {'path': path}, status="404")