The problem is that any given file or directory isn't necessarily supposed to be public to other users. My concern is really memory constraints -- outputting each file via Python in the following fashion probably isn't very memory efficient, whereas Apache is probably very efficient. However, I can't directly perform any auth with Apache
# Example code: response = HttpResponse() file = open("/path/to/users/file.html", "r") for line in file: response.write(line) return response
I figure I have two options here, since these are all going to be static files:
Am I wrong in thinking that the above is not memory-efficient? Which would you guys go with?
(I know this is kinda of a long post. Sorry about that, and thanks in advance)
asked May 28 '11 at 19:58
Personally, I think the correct approach is to serve the files separately and not directly from the Django application. The problem, as you stated, is that you just need authentication on those downloads. You should be able to do that using