-
Notifications
You must be signed in to change notification settings - Fork 45
Use django-storages, at least as parent class #21
Comments
It's definitely possible, and the way to go moving forward. Back when we forked off from django-storages, their boto S3 backend had some issues that I didn't have the time or will to deal with then. As the project has grown, it's likely that the situation has improved greatly, but I haven't had the time/motivation to see where things stood today. I would gladly accept research and/or pull requests conducted by others, though. I am unlikely to tackle this anytime soon, since things are working pretty well right now. It's probably not a massive project, but care needs to be taken to prevent backwards incompatibilities. |
Agreed, this is a better long-term solution for #22. |
If the current upstream django-storages already has support for what #22 is doing, that would be perhaps be additional motivation. If anyone wants to take a stab at this, I'd love to see it happen. I may suggest preserving compatibility by making our S3BotoStorage a sub-class of django-storages. We'd probably need to mixin or find another way to do this: https://github.com/gtaylor/django-athumb/blob/master/athumb/backends/s3boto.py#L216 That's technically not part of the Django storage API's "interface", but has been a useful addition for us. It may make sense to see if this fits upstream in django-storages, since it's more of a general-purpose thing. |
Sure I'll take a stab this. It worries me a little not to have any tests, because it is hard to know if maybe upgrading django-storages will break anything, but why don't I just try that first, and if I am feeling motivated start writing some tests as well. |
It's not a 100% substitute for a good test suite, but we can run your branch on our staging servers at Pathwright to see if anything turns up during our regular QA process. |
Does |
Yes. It tells S3 to generate a link that will have a different Content-Disposition header in the response ('attachment'). Worse case, do your thing and leave me to deal with that method. I may try to figure out a better way to approach this. |
Do you need to override the |
If you're talking about this: https://github.com/gtaylor/django-athumb/blob/master/athumb/backends/s3boto.py#L260 That's really the whole point of the S3BotoStorage_AllPublic backend. It's going to naively spit something out regardless of what you're doing. It won't bother with any of the signature generation that Boto does, and there is no possibility of contacting S3 for anything. So what we really need to do is just make S3BotoStorage a sub-class of the upstream django-storages class, remove basically everything from it, and see what breaks. |
Try the code at #23 |
Looking through the changes between
S3BotoStorage
in this repo and in django-storages, I wasn't sure what the significant changes were. Would it be possible to use thedjango-storages
backend with this project? or if there are important changes to that backend, then maybe installdjango-storages
and subclass their version?That way it would be easier to see what this storage does in comparison their version.
The text was updated successfully, but these errors were encountered: