I might be conflicting with django media settings but I have to append media to the path.
I added the following url:
# protected media
url(r'^media/(?P<path>.*)$', get_media, name='get_media')
Then the get_media function based view:
def get_media(request, path):
# append media to path
return sendfile(request, 'media/' + path)
If I don't append media. then it fails here:
if not os.path.exists(filename):
from django.http import Http404
raise Http404('"%s" does not exist' % filename)