From 3e7b85c53fb0411a536a02b3a494276e1fcb5131 Mon Sep 17 00:00:00 2001 From: Thomas Steen Rasmussen Date: Sun, 19 Feb 2017 14:04:31 +0100 Subject: [PATCH] missing import, and add /public/ to the start of the url --- src/program/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/program/views.py b/src/program/views.py index eb673de7..a16f6cd3 100644 --- a/src/program/views.py +++ b/src/program/views.py @@ -10,6 +10,8 @@ from django.views import View from django.views.decorators.http import require_safe from django.http import Http404 from django.utils.decorators import method_decorator +from django.http import HttpResponse + @method_decorator(require_safe, name='dispatch') class SpeakerPictureView(CampViewMixin, DetailView): @@ -34,7 +36,7 @@ class SpeakerPictureView(CampViewMixin, DetailView): # (this works for nginx only, other webservers use x-sendfile), # TODO: what about runserver mode here? response = HttpResponse() - response['X-Accel-Redirect'] = '/_media/speakers/%(campslug)s/%(speakerslug)s/%(filename)s' % { + response['X-Accel-Redirect'] = '/public/speakers/%(campslug)s/%(speakerslug)s/%(filename)s' % { 'campslug': self.camp.slug, 'speakerslug': self.get_object().slug, 'filename': picture.name