How do I get the service URL for Google Cloud Storage objects on the App Engine developer server?

I have an App Engine app for python and save files using the Google Cloud Storage API. However, I need to get the url for each file.

During the production process, it’s easy to understand which URL is for the services, as I add http://commondatastorage.googleapis.com to /bucket/path/to/file.txt , since I already have a name and path to my file.

How to find out what service URL is on the dev server?

It seems straightforward enough to do this with images using images.get_serving_url , which can now use blobstore or Cloud Storage links.

How can I determine the URL for all files, not just images in a way that is compatible with the App Engine development and production environment?

+6
source share
1 answer

You can use GCS through the blobstore API. See this section on how to configure the service handler for the GCS key:

https://developers.google.com/appengine/docs/python/blobstore/#Python_Using_the_Blobstore_API_with_Google_Cloud_Storage

+1
source

All Articles