How to fix the shit heavy when reading Google Cloud Storage images from Django deployed on GAE

Problem discovery

When deploying Django, I think many people are reluctant to use GAE. In that case, I think that many people are using the simple Google Cloud Strage. https://django-storages.readthedocs.io/en/latest/backends/gcloud.html

I made an API that spits out about 50 images in that environment, but it was extremely heavy.

Looking at the url

https://storage.googleapis.com/hogestorage/photos/hoge.png?Expires=1573177689&GoogleAccessId=hogehoge&Signature=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Looking at the DB

/photos/hoge.png

......

You resolve the names one by one and manage the authority!

This is heavy.

The public image is the default for the service used this time, so change it.

Make the entire bucket public

GS_DEFAULT_ACL = 'publicRead'

When you do API url

https://storage.googleapis.com/hogestorage/photos/hoge.png

It will be detonation velocity.

Recommended Posts

How to fix the shit heavy when reading Google Cloud Storage images from Django deployed on GAE
Implemented in Dataflow to copy the hierarchy from Google Drive to Google Cloud Storage
How to build an application from the cloud using the Django web framework
With Django + Google Cloud Strage, ImageField images are displayed normally on the server
How to use the Google Cloud Translation API
How to add pre-save processing when adding objects on the Django admin site
How to pass arguments when invoking python script from blender on the command line
How to deploy a Django application on Alibaba Cloud
How to use Azure Table storage from Django (PTVS)
From python to running instance on google cloud platform
How to use Django on Google App Engine / Python
How to connect to Cloud SQL PostgreSQL on Google Cloud Platform from a local environment with Java
How to do the initial setup from Django project creation
Reading and writing Files from notebook on Watson Studio to IBM Cloud Object Storage (ICOS)-using project-lib-
How to connect to Cloud Firestore from Google Cloud Functions with python code
How to update the python version of Cloud Shell on GCP
How to check local GAE from iPhone browser in the same LAN
How to use gcc when compiling extension modules from setup.py on Mac
How to deal with OAuth2 error when using Google APIs from Python
When introducing the Google Cloud Vision API to rails, I followed the documentation.
Garbled characters when uploading CSV to Google Cloud Storage → Solved by json
Copy data from Amazon S3 to Google Cloud Storage with Python (boto)
How to pass values to JavaScript variables directly from the [Django] template tag
How to make only one data register on the Django admin screen
GAE --With Python, rotate the image based on the rotation information of EXIF and upload it to Cloud Storage.