S3 Lifecycle expiration

22 views
Skip to first unread message

Britto .

unread,
May 4, 2019, 4:11:18 AM5/4/19
to Django users
Hello All,

How could we set S3 life-cycle expiration for a file from Django when uploading to S3 back-end?


Regards
Britto

Hardipinder Singh

unread,
May 4, 2019, 6:54:43 AM5/4/19
to django...@googlegroups.com
Hey Britto,

Check boto3 for this. Django can be used to check data using services.py. 

Hope this helps

Thanks & Regards
Hardipinder Singh
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAF0v3b5_0x4VfCSz9qaCkhGspPkfGyaR%3DgcdR1owbMTMWMqWBQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Britto .

unread,
May 4, 2019, 10:00:45 AM5/4/19
to Django users
Not clear what are you referring with services.py. I know boto3 and django-storages. But how to configure it is the question.

For boto3 there is a settings.py variable AWS_S3_OBJECT_PARAMETERS through that we could set expiration.
Just wanted to make sure that how do we set different expiration for each object uploaded?


Regards
Britto


Hardipinder Singh

unread,
May 6, 2019, 9:40:19 PM5/6/19
to django...@googlegroups.com
Hey Britto,

What I meant was have a separate data script made with boto3 where you got though every bucket id one at a time and set the values accordingly. Please check the developer documentation for same. You’ll surely find a matching function for this. 

By services I meant that using django check the first you check for the value entered by boto in db. Now you match it with the date of you choice if it matches, call another function to update or use the data script. 

All depends upon the way you wish to execute the whole code.

Regards
Hd

Reply all
Reply to author
Forward
0 new messages