Referencing Cloud Storage objects by key in the local sandbox

8 views
Skip to first unread message

pdohe...@gmail.com

unread,
Mar 26, 2019, 3:18:59 PM3/26/19
to djangae-users
The documentation states, "You can serve files directly from cloudstorage with the key". 

Is it possible to do this from withing the local sandbox in order to prevent me from having to add conditionals to check which environment the app is running in when trying to populate things like image source attributes? All of my attempts have resulted in 404s, which makes sense because, as far as I can tell, objects aren't actually uploaded to CloudStorage from within the local sandbox and can't be referenced using http://storage.googleapis.com/BUCKET/path-to-file.

David Buxton

unread,
Mar 27, 2019, 10:40:07 AM3/27/19
to djangae-users
What are you trying to do?

Regarding using the local dev server with the live storage bucket, see previous comment https://github.com/potatolondon/djangae/issues/787#issuecomment-469824445

David

pete.d...@stinkstudios.com

unread,
Mar 27, 2019, 12:42:46 PM3/27/19
to djangae-users
Thanks for following up, David.

I was hoping to be able to use cloud object keys when referencing objects in order to avoid routing those requests through my application. Naturally, I realized shortly after posting this yesterday that that wasn't going to be possible.

I did go back and reference our previous exchange and, if I determine this is the approach I need to take, will revisit that option.

Either way, I'd like to submit a PR which updates the documentation and explains just when/where/how referencing objects by key is possible. As it stands, I think the documentation is a little confusing.

David Buxton

unread,
Mar 27, 2019, 1:02:20 PM3/27/19
to djangae-users
But it sounds like this is only getting complicated for local development, that when deployed to App Engine everything should work correctly, is that right?

pete.d...@stinkstudios.com

unread,
Mar 27, 2019, 1:09:21 PM3/27/19
to djangae-users
Yes, that's correct.

For anyone who sees this in the future: it sounds like my two options are to either add a layer of indirection (template filter?) which sniffs out the environment and returns the appropriate URL or configure my app to upload files to cloud storage from the local sandbox.
Reply all
Reply to author
Forward
0 new messages