Stay organized with collections Save and categorize content based on your preferences.
You can use a Cloud Storage bucket to store and serve files, such as movies or images or other static content. This document describes how to set up your environment to use the App Engine client library for Cloud Storage.
This API is supported for first-generation runtimes and can be used when upgrading to corresponding second-generation runtimes. If you are updating to the App Engine Python 3 runtime, refer to the migration guide to learn about your migration options for legacy bundled services. Setting up your projectCreate a Google Cloud project, and understand how Python 2 apps are structured in App Engine. Write down and save your project ID for use with your application.
Activating a Cloud Storage bucketTo use Cloud Storage, you'll need to activate at least one bucket. You might want to use the default bucket which provides the first 5GB of storage for free. You can activate and use another Cloud Storage bucket. The default bucket includes the first 5GB of storage for free. The default bucket also includes a free quota for Cloud Storage I/O operations. See Pricing, quotas, and limits for more details.
To activate the default Cloud Storage bucket for your app:
Click Create under Default Cloud Storage Bucket in the App Engine settings page for your project. Notice the name of this bucket: it is in the form <project-id>.appspot.com
.
If you need more storage than the 5GB limit, you can increase this by enabling billing for your project, making this a paid bucket. You will be charged for storage over the 5GB limit.
If you want to activate one or more paid buckets, follow the instructions under Creating a bucket to activate them.
Note: When you create a default bucket, you also get a staging bucket with the same name except thatstaging.
is prepended to it. You can use this staging bucket for temporary files used for staging and test purposes; it also has a 5 GB limit, but it is automatically emptied on a weekly basis. Setting bucket and object permissions
You can find information on allowing your app's service account or other users access the storage bucket and its contents in Setting bucket permissions and Setting object permissions.
Downloading the client libraryYou can download the App Engine client library for Cloud Storage using popular tools like pip
or Git. Alternatively, you can download the library manually from GitHub. Choose your preferred method:
If you have Git installed, you can clone the GitHub repository for App Engine's Cloud Storage client library as follows:
git clone https://github.com/googleapis/python-storage.git
pip
You can use pip
to install the Cloud Storage client library as follows:
pip install google-cloud-storage
Important: The pip
command downloads and installs the PyPi distribution of the Cloud Storage client library. This distribution does not include demo or test code. To obtain these files, clone or download the library's GitHub repository. Manual download
You can download a ZIP file containing the App Engine client library for Cloud Storage from GitHub:
App Engine client library for Cloud Storage on GitHub
Install the library into the directory you are using for third-party libraries, such as lib
. For more information, see Using third-party libraries.
You can use the client library with the development server. However because there is no local emulation of Cloud Storage, all requests to read and write files must be sent over the Internet to an actual Cloud Storage bucket.
To use the client library with the development app server:
Run dev_appserver.py
with the flag --default_gcs_bucket_name [BUCKET_NAME]
, replacing [BUCKET_NAME]
with the name of the Cloud Storage bucket you are using.
This flag controls the bucket that will be returned when your application calls file.DefaultBucketName(ctx)
.
There are no bandwidth charges associated with making calls to Cloud Storage from App Engine's client library. However, there are operations charges. In addition, the calls count against your URL fetch quota as the library uses the URL Fetch service to interact with Cloud Storage.
Notice that Cloud Storage is a pay-to-use service; you will be charged according to the Cloud Storage price sheet.
Alternative ways to access Cloud StorageInstead of using the client library, you could use the following:
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-18 UTC."],[[["Cloud Storage buckets can be used to store and serve static content like movies and images, and this document explains how to set up the environment for using the App Engine client library for Cloud Storage."],["Activating a Cloud Storage bucket, such as the default bucket which offers 5GB of free storage, is necessary to use this feature."],["The App Engine client library for Cloud Storage can be downloaded through `pip`, Git, or a manual download from GitHub."],["When using the client library with the development app server, requests to read and write files are sent to an actual Cloud Storage bucket over the internet, requiring the `--default_gcs_bucket_name` flag."],["While there are no bandwidth charges, calls to Cloud Storage using the client library incur operations charges and contribute to the URL fetch quota."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4