<br />

<br />

<br />

<br />

<br />

<br />


> [!NOTE]
> **Note:** Some [Python runtimes](https://docs.cloud.google.com/appengine/docs/flexible/lifecycle/support-schedule#python) have reached [end of support](https://docs.cloud.google.com/appengine/docs/flexible/lifecycle/runtime-lifecycle#end_of_support). You cannot re-deploy versions that use runtimes after their end of support date. We recommend that you [upgrade your app](https://docs.cloud.google.com/appengine/docs/flexible/python/runtime#newversions) to use the latest version of Python.

<br />


An App Engine app is configured using an `app.yaml`
file, that contains CPU, memory, network and disk resources, scaling, and other
general settings including environment variables.


## About `app.yaml` files

<br />

You can specify the runtime configuration for your Python app, including versions and URLs, in the `app.yaml` file. This file acts as a deployment descriptor of a specific [service](https://docs.cloud.google.com/appengine/docs/flexible/an-overview-of-app-engine) version.

<br />


You must first create the `app.yaml` file for the `default` service of your app
before you can create and deploy `app.yaml` files for additional services.


The following `app.yaml` demonstrates how to configure your app to use
the latest version of Python. To use any other [supported version](https://docs.cloud.google.com/appengine/docs/flexible/lifecycle/support-schedule#python) of Python,
you must update your `app.yaml` file. For more information, see
[Python runtime](https://docs.cloud.google.com/appengine/docs/flexible/python/runtime).

    # Copyright 2021 Google LLC
    #
    # Licensed under the Apache License, Version 2.0 (the "License");
    # you may not use this file except in compliance with the License.
    # You may obtain a copy of the License at
    #
    #      http://www.apache.org/licenses/LICENSE-2.0
    #
    # Unless required by applicable law or agreed to in writing, software
    # distributed under the License is distributed on an "AS IS" BASIS,
    # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    # See the License for the specific language governing permissions and
    # limitations under the License.

    runtime: python
    env: flex
    entrypoint: gunicorn -b :$PORT main:app

    runtime_config:
      operating_system: ubuntu24
      runtime_version: 3.14

    # This sample incurs costs to run on the App Engine flexible environment.
    # The settings below are to reduce costs during testing and are not appropriate
    # for production use. For more information, see:
    # https://cloud.google.com/appengine/docs/flexible/python/configuring-your-app-with-app-yaml
    manual_scaling:
      instances: 1
    resources:
      cpu: 1
      memory_gb: 0.5
      disk_size_gb: 10


Depending on the complexity of your app's service, you might only need to define
a few elements in the corresponding `app.yaml` file. The following example
demonstrates what a simple Python app might require in the
flexible environment:


You can specify a unique name for your `app.yaml` files, but then you must
specify the file name with the [deployment
command](https://docs.cloud.google.com/appengine/docs/flexible/testing-and-deploying-your-app)
as well. For example, if you name your `app.yaml` file `service-name-app.yaml`
or `app.flexible.yaml`, then you must deploy your app using either:

    gcloud app deploy service-name-app.yaml
    gcloud app deploy app.flexible.yaml

To learn more about structuring multiple services and `app.yaml` files in your app, see [Structuring web services](https://docs.cloud.google.com/appengine/docs/flexible/configuration-files).

<br />

## All configuration elements

For a complete list of all the supported elements in this configuration file,
see the
[`app.yaml` reference](https://docs.cloud.google.com/appengine/docs/flexible/reference/app-yaml).