Hi
I am using apache2 server with xsend file to protect against static files,
the python view is:
@staff_member_required
def media_xsendfile(request, path, document_root):
print "is staff",request.user.is_staff
response = HttpResponse()
response['Content-Disposition'] = 'attachment'
response['X-Sendfile'] = (os.path.join(document_root,
path)).encode('utf-8')
return response
and in apache httpd.conf
XSendFile on
XSendFilePath /path/to/files/
If the user is not a staff member, he is redirected correctly to the login
page and once he login, the file is download, this is only in the local
development server, however when I use apache server, after the first login
nothing happens (the login page is still there) and he has to login
again.for the file to be downloaded.
Any clue ?
Thanks
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/_5o_fX1N6n0J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.