Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally override querystring_expire in S3BotoStorage.url #96

Merged
merged 1 commit into from
Jan 13, 2016
Merged

Optionally override querystring_expire in S3BotoStorage.url #96

merged 1 commit into from
Jan 13, 2016

Conversation

mattbriancon
Copy link
Contributor

It's often inconvenient to instantiate a new instance of S3BotoStorage just to change the expiration of URLs. Instead I'd like to (optionally) pass the new expiration with each call to S3BotoStorage.url.

pic = MyModel.objects.get(...).picture
pic.storage.url(pic.name)  # default expiration
pic.storage.url(pic.name, expire=600)  # custom expiration

Happy to make adjustments or take another approach. Thanks!

@mattbriancon
Copy link
Contributor Author

@jschneier any thoughts here? Hoping to get this in quickly. Thanks!

@jschneier
Copy link
Owner

this is fine. It's annoying that boto takes this one arg as a position arg and everything else as kwarg but that's the api i suppose. thanks for writing a test.

jschneier added a commit that referenced this pull request Jan 13, 2016
Optionally override querystring_expire in S3BotoStorage.url
@jschneier jschneier merged commit 1479829 into jschneier:master Jan 13, 2016
mbarrien added a commit to mbarrien/django-storages that referenced this pull request Jan 13, 2016
@mattbriancon mattbriancon deleted the s3boto-url-expires branch January 14, 2016 17:47
@avinassh
Copy link

When this will be released in PyPi version? Last version was released 5 months ago (looking at the last timestamp on setup.py)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants