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开发者_如何学JAVA download is denied.
Thanks Eric
As you are using Apache, take a look to
http://docs.djangoproject.com/en/1.2/howto/apache-auth/
http://code.google.com/p/modwsgi/wiki/AccessControlMechanisms
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/
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! :)
精彩评论