Closed shubhamc183 closed 3 years ago
Closing this ticket due to inactivity.
Old issue but I was trying to do this stupid thing and wasted an hour. The static files container has to be public as use_temp_urls is set to False on the StaticSwiftStorage class and so the temp_key doesn't get passed in the GET request and hence the request is denied.
class StaticSwiftStorage(SwiftStorage):
container_name = setting('SWIFT_STATIC_CONTAINER_NAME', '')
name_prefix = setting('SWIFT_STATIC_NAME_PREFIX', '')
auto_base_url = setting('SWIFT_STATIC_AUTO_BASE_URL', True)
override_base_url = setting('SWIFT_STATIC_BASE_URL')
auto_create_container_public = True
use_temp_urls = False
You can subclass and overrule this, but why bother? Make the static files container public instead since it's so easy to create separate containers and it's static files so why waste cycles generating access signatures for every file.
I have set the swift storage as
And I am able to do a normal file upload and collectstatic but getting error while fetching the file.
Somehow, the keys are not getting mapped in HTTP Headers I guess...!
Can I add media folders also?