|
Hi guys, 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) |
|
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 http://community.webfaction.com/questions/1066/installing-mod_xsendfile-on-django-apache-instance |