0

Is there a way for Apache to allow or deny a file download after checking with Django for permission?

That is, I want the user to have a permission within Django to determine if the user has the rights to a file. And, if the user has the permission, Apache would start the file download. Or, if the permission is not set for that user, the download is denied.

Thanks Eric

3 Answers3

1

I don't think it's possible like that. Why don't you serve the file through Django itself? See http://djangosnippets.org/snippets/365/

petteri
  • 354
  • 2
  • 7
1

As you are using Apache, take a look to

naw
  • 1,496
  • 12
  • 13
0

After more searching, I found this:

How to return static files passing through a view in django?

I think this is what I will do.

Thanks! :)

Community
  • 1
  • 1
  • That suggest loading whole thing into memory. Not really resource friendly. Second suggestion they give is redirect, it's fine but not bulletproof. – petteri Aug 15 '10 at 19:22