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

Conversation

Projects
None yet
3 participants
@mattbriancon
Copy link
Contributor

commented Nov 17, 2015

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

This comment has been minimized.

Copy link
Contributor Author

commented Nov 18, 2015

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

@jschneier

This comment has been minimized.

Copy link
Owner

commented Jan 13, 2016

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

Merge pull request #96 from mattbriancon/s3boto-url-expires
Optionally override querystring_expire in S3BotoStorage.url

@jschneier jschneier merged commit 1479829 into jschneier:master Jan 13, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

mbarrien added a commit to mbarrien/django-storages that referenced this pull request Jan 13, 2016

@mattbriancon mattbriancon deleted the mattbriancon:s3boto-url-expires branch Jan 14, 2016

@avinassh

This comment has been minimized.

Copy link

commented Jan 19, 2016

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
You can’t perform that action at this time.