[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-08-19 UTC。"],[[["\u003cp\u003eCloud 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.\u003c/p\u003e\n"],["\u003cp\u003eActivating a Cloud Storage bucket, such as the default bucket which offers 5GB of free storage, is necessary to use this feature.\u003c/p\u003e\n"],["\u003cp\u003eThe App Engine client library for Cloud Storage can be downloaded through \u003ccode\u003epip\u003c/code\u003e, Git, or a manual download from GitHub.\u003c/p\u003e\n"],["\u003cp\u003eWhen 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 \u003ccode\u003e--default_gcs_bucket_name\u003c/code\u003e flag.\u003c/p\u003e\n"],["\u003cp\u003eWhile there are no bandwidth charges, calls to Cloud Storage using the client library incur operations charges and contribute to the URL fetch quota.\u003c/p\u003e\n"]]],[],null,["# Setting Up Google Cloud Storage\n\nYou can use a Cloud Storage bucket\nto store and serve files, such as movies or images or other static content. This\ndocument describes how to set up your environment to use the App Engine client\nlibrary for Cloud Storage.\n| This API is supported for first-generation runtimes and can be used when [upgrading to corresponding second-generation runtimes](/appengine/docs/standard/\n| python3\n|\n| /services/access). If you are updating to the App Engine Python 3 runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/python-differences) to learn about your migration options for legacy bundled services.\n\nSetting up your project\n-----------------------\n\nCreate a Google Cloud project, and understand how Python 2 apps are\nstructured in App Engine. Write down and save your project ID for use\nwith your application.\n\nActivating a Cloud Storage bucket\n---------------------------------\n\nTo use Cloud Storage, you'll need to activate at least one bucket.\nYou might want to use the default bucket which provides the first 5GB of\nstorage for free. You can activate and use another Cloud Storage\nbucket. The default bucket includes\nthe first 5GB of storage for free. The default bucket\nalso includes a free quota for Cloud Storage I/O operations. See\n[Pricing, quotas, and limits](#pricing_quotas_and_limits)\nfor more details.\n\nTo activate the default Cloud Storage bucket for your app:\n\n1. Click **Create** under *Default Cloud Storage Bucket* in the\n [App Engine settings](https://console.cloud.google.com/appengine/settings) page for your project.\n Notice the name of this bucket: it is in the form `\u003cproject-id\u003e.appspot.com`.\n\n2. If you need more storage than the 5GB limit, you can\n increase this by [enabling billing](https://console.cloud.google.com/billing) for your project,\n making this a paid bucket. You will be charged for storage over the 5GB limit.\n\nIf you want to activate one or more paid buckets, follow the instructions under\n[Creating a bucket](/storage/docs/cloud-console#_creatingbuckets) to activate\nthem.\n| **Note:** When you create a default bucket, you also get a staging bucket with the same name except that `staging.` 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.\n\n### Setting bucket and object permissions\n\nYou can find information on allowing your app's service account or other users\naccess the storage bucket and its contents in\n[Setting bucket permissions](/storage/docs/cloud-console#_bucketpermission) and\n[Setting object permissions](/storage/docs/cloud-console#_permissions).\n\nDownloading the client library\n------------------------------\n\nYou can download the App Engine client library for Cloud Storage using popular tools\nlike [`pip`](https://pip.pypa.io/en/latest/index.html) or\n[Git](http://git-scm.com). Alternatively, you can download\nthe library manually from GitHub. Choose your preferred method: \n\n### Git\n\nIf you have Git installed, you can clone the GitHub repository for\nApp Engine's Cloud Storage client library as follows: \n\n git clone https://github.com/googleapis/python-storage.git\n\n### pip\n\nYou can use `pip` to install the Cloud Storage\nclient library as follows: \n\n pip install google-cloud-storage\n\n| **Important:** The `pip` command downloads and installs the [PyPi distribution](https://pypi.org/project/google-cloud-storage/) 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.\n\n### Manual download\n\nYou can download a ZIP file containing the App Engine client library for\nCloud Storage from GitHub:\n\n[App Engine client library for Cloud\nStorage on GitHub](https://github.com/googleapis/python-storage/archive/refs/heads/main.zip)\n\nInstall the library into the directory you are using for third-party libraries,\nsuch as `lib`. For more information, see [Using third-party\nlibraries](/appengine/docs/legacy/standard/python/tools/using-libraries-python-27).\n\nUsing the client library with the development app server\n--------------------------------------------------------\n\nYou can use the client library with the development server. However because\nthere is no local emulation of Cloud Storage, all requests to read and write\nfiles must be sent over the Internet to an actual Cloud Storage bucket.\n\nTo use the client library with the development app server:\n\n1. [Activate a Cloud Storage bucket](#activating_a_cloud_storage_bucket).\n\n2. Run `dev_appserver.py` with the flag `--default_gcs_bucket_name [BUCKET_NAME]`,\n replacing `[BUCKET_NAME]` with the name of the Cloud Storage bucket you are\n using.\n\n This flag controls the bucket that will be returned when your application\n calls `file.DefaultBucketName(ctx)`.\n\nPricing, quotas, and limits\n---------------------------\n\nThere are no bandwidth charges associated with making calls to Cloud Storage from\nApp Engine's client library. However, there are\n[operations charges](/storage/pricing#operations-pricing).\nIn addition, the calls count against your\n[URL fetch quota](/appengine/docs/quotas#UrlFetch)\nas the library uses the URL Fetch service to interact with Cloud Storage.\n\nNotice that Cloud Storage is a pay-to-use service;\nyou will be charged according to the Cloud Storage [price sheet](/storage/pricing).\n\nAlternative ways to access Cloud Storage\n----------------------------------------\n\nInstead of using the client library, you could use the following:\n\n- [Cloud Storage Browser](https://console.cloud.google.com/storage/browser) in the Google Cloud console, which is useful for uploading objects quickly.\n- [gsutil](/storage/docs/gsutil), which is a command-line tool for working with files in Cloud Storage.\n\nWhat's next\n-----------\n\n- Visit the [API Reference documentation](/appengine/docs/legacy/standard/python/googlecloudstorageclient/functions).\n- Learn how to [read and write to Cloud Storage](/appengine/docs/legacy/standard/python/googlecloudstorageclient/read-write-to-cloud-storage) with the App Engine client library for Cloud Storage.\n- Review the [App Engine and Google Cloud Storage sample](/appengine/docs/legacy/standard/python/googlecloudstorageclient/app-engine-cloud-storage-sample).\n- View the complete set of [Cloud Storage documentation](/storage/docs), including additional samples and tutorials."]]