简体   繁体   English

我可以使用django扫描亚马逊s3中的普通文件夹

[英]Can i scan the files like normal folder in amazon s3 with django

I have the Django app and i am thinking of using the Amazon S3 for storing 20GB of pdf files. 我有Django应用程序,我正在考虑使用Amazon S3存储20GB的pdf文件。

Now i won't be directly serving them but i am thinking of like this. 现在我不会直接为他们服务,但我想是这样的。 please give me right direction if something is wrong 如果出现问题,请给我正确的指示

  1. Django will scan the all files from S3 and will populate the database tables of all filenames , sizes etc. Django将扫描S3中的所有文件,并将填充所有文件名,大小等的数据库表。

  2. Then i will show the list of them om web page so that i can track the how many times the file is downloaded 然后我将显示它们的网页列表,以便我可以跟踪文件的下载次数

  3. Then i will serve the file from amazon S3 然后我将从亚马逊S3提供文件

Is this kind of thing possible 这种事情有可能吗?

My Django app is using apache , mod_wsgi and VPS server Centos 6 我的Django应用程序使用的是apache,mod_wsgi和VPS服务器Centos 6

Yes, this should be possible (and is in fact a good way to go). 是的,这应该是可能的(事实上这是一个很好的方式)。 You can use the boto library to scan your directory on S3 to store it in your database. 您可以使用boto库 扫描S3的目录,以将其存储在数据库中。 With this information you can generate download links for the files. 使用此信息,您可以生成文件的下载链接 It is also possible to automatically let the download links from S3 expire after a certain amount of time. 也可以自动让S3的下载链接在一定时间后过期。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM