[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[[["\u003cp\u003eThe \u003ccode\u003eREGION_ID\u003c/code\u003e is a code assigned by Google based on the region selected during app creation, included in App Engine URLs for apps created after February 2020.\u003c/p\u003e\n"],["\u003cp\u003eYou can deploy your web service to App Engine using the \u003ccode\u003egcloud app deploy\u003c/code\u003e command, with each deployment creating a new version of your app.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egcloud app browse\u003c/code\u003e command allows you to quickly access your deployed web service in a browser using a URL containing your \u003ccode\u003ePROJECT_ID\u003c/code\u003e and \u003ccode\u003eREGION_ID\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eApp Engine manages multiple versions of your service, with the initial deployment in the \u003ccode\u003edefault\u003c/code\u003e service, and updates automatically routing traffic to the latest deployed version.\u003c/p\u003e\n"],["\u003cp\u003eYou can use the Google Cloud console to view and manage your App Engine services and the different deployed versions.\u003c/p\u003e\n"]]],[],null,["# Deploy your web service\n\n### Region ID\n\nThe \u003cvar translate=\"no\"\u003eREGION_ID\u003c/var\u003e is an abbreviated code that Google assigns\nbased on the region you select when you create your app. The code does not\ncorrespond to a country or province, even though some region IDs may appear\nsimilar to commonly used country and province codes. For apps created after\nFebruary 2020, \u003cvar translate=\"no\"\u003eREGION_ID\u003c/var\u003e`.r` is included in\nApp Engine URLs. For existing apps created before this date, the\nregion ID is optional in the URL.\n\nLearn more\n[about region IDs](/appengine/docs/standard/python3/how-requests-are-routed#region-id). \nOK\n\n\u003cbr /\u003e\n\n| **Note:** If you are deploying a new Python web service to Google Cloud, we recommend getting started with [Cloud Run](/run/docs/quickstarts/build-and-deploy/deploy-python-service).\n\nUse the [Google Cloud CLI](/sdk/gcloud/reference/app) to\ndeploy your web service to App Engine.\n\nThough this initial version of the web service doesn't have\nFirestore in Datastore mode (Datastore) or Firebase authentication,\nyou can deploy it to App Engine at this stage to test and ensure that\nit works as expected.\n\nBefore you begin\n----------------\n\nIf you have completed all the previous steps in this guide, skip this section.\nOtherwise, complete one of the following:\n\n- Start from [Build a Python 3 App](/appengine/docs/standard/python3/building-app)\n and complete all the steps leading up to this one.\n\n- If you already have a\n [Google Cloud project](/appengine/docs/standard/python3/building-app/creating-gcp-project),\n you can continue by downloading a copy of the web service:\n\n 1. Download the sample application repository using\n [Git](https://git-scm.com/):\n\n git clone https://github.com/GoogleCloudPlatform/python-docs-samples\n\n Alternatively, you can [download the sample](https://github.com/GoogleCloudPlatform/python-docs-samples/archive/master.zip) as a zip\n file and then extract it.\n 2. Navigate to the directory that contains a copy of the files from the\n previous step:\n\n cd python-docs-samples/appengine/standard_python3/building-an-app/building-an-app-1\n\nDeploy your service\n-------------------\n\nTo deploy your web service, you run the\n[`gcloud app deploy`](/sdk/gcloud/reference/app/deploy) command from the root\ndirectory of your project, where your `app.yaml` file is located: \n\n gcloud app deploy\n\nEach time that you deploy your web service, a new\n[version](/appengine/docs/an-overview-of-app-engine) of that\napp is created in App Engine. During deployment, a container image is\ncreated using the [Cloud Build](/container-builder/docs) service, and\nthen a copy is uploaded to Google Cloud Storage before it is run in\nApp Engine.\n\nFor more information about deploying to App Engine, see\n[Testing and Deploying Your App](/appengine/docs/standard/testing-and-deploying-your-app).\n| **Note:** Files listed in your [`.gcloudignore`](/sdk/gcloud/reference/topic/gcloudignore) file are not uploaded to App Engine during deployment.\n\nViewing your service\n--------------------\n\nTo quickly launch your browser and access your web service at\n\n`https://`\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e`.`\u003cvar translate=\"no\"\u003e\u003ca href=\"#appengine-urls\" style=\"border-bottom: 1px dotted #999\" class=\"devsite-dialog-button\" data-modal-dialog-id=\"regional_url\" track-type=\"progressiveHelp\" track-name=\"modalHelp\" track-metadata-goal=\"regionalURL\"\u003eREGION_ID\u003c/a\u003e\u003c/var\u003e`.r.appspot.com`, enter the following\ncommand: \n\n gcloud app browse\n\n| **Tip:** If you would like to change the URL of your web service to something other than the default `https://`\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e`.`\u003cvar translate=\"no\"\u003e\u003ca href=\"#appengine-urls\" style=\"border-bottom: 1px dotted #999\" class=\"devsite-dialog-button\" data-modal-dialog-id=\"regional_url\" track-type=\"progressiveHelp\" track-name=\"modalHelp\" track-metadata-goal=\"regionalURL\"\u003eREGION_ID\u003c/a\u003e\u003c/var\u003e`.r.appspot.com` URL, you can [add a custom domain](/appengine/docs/standard/mapping-custom-domains).\n\nManaging services and versions\n------------------------------\n\nYou've just deployed a version of the web service to App Engine. Each\ntime that you deploy a version of your code, that version is created in a\nservice. The initial deployment to App Engine must be created in the\n`default` service, but for subsequent deployments, you can\n[specify the name of your service in your `app.yaml` file](/appengine/docs/standard/reference/app-yaml#service).\n\nYou can update a service at any time by running the\n`gcloud app deploy` command and deploying new versions to that service. Each\ntime that you update a service, traffic is automatically routed to the version\nlast deployed. However, you can include\n[`gcloud` flags](/sdk/gcloud/reference/app/deploy) to change the deploy command\nbehavior.\n\nUse the Google Cloud console to manage and view the services and versions that\nyou deploy to\nApp Engine:\n\n- Use the Google Cloud console to view your App Engine services:\n\n [Go to the services page](https://console.cloud.google.com/appengine/services)\n- Use the Google Cloud console to view your versions:\n\n [Go to the versions page](https://console.cloud.google.com/appengine/versions)\n\nFor more information about the multi-service design pattern, see\n[An Overview of App Engine](/appengine/docs/an-overview-of-app-engine).\nTo learn how to send requests to specific services and versions, see\n[Splitting Traffic](/appengine/docs/standard/splitting-traffic).\n\nNext steps\n----------\n\nNow that you have a Python service running on App Engine,\nyou're ready to learn how to handle data with Datastore."]]