开发者

How to allow download of file via Apache with Django's permission?

开发者 https://www.devze.com 2023-01-11 10:46 出处:网络
Is there a way for Apache to allow or deny a file download after checking with Django for permission?

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! :)

0

精彩评论

暂无评论...
验证码 换一张
取 消