A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://cloud.google.com/appengine/docs/standard/python3/migrate-to-python3/config-files below:

Preparing configuration files for the Python 3 runtime | Google App Engine standard environment docs

Preparing configuration files for the Python 3 runtime

Stay organized with collections Save and categorize content based on your preferences.

Before you can run your app in the Python 3 runtime of the App Engine standard environment, you may need to change some of the configuration files that App Engine uses:

Updating app.yaml

The behavior of some fields in your app.yaml configuration file has been modified. Remove any fields that are no longer supported and update other fields as described in the following table.

Field Change type Description app_engine_apis Applicable to Python 3 only Required to be set to true if you want to access the legacy bundled services for Python 3. api_version
application_readable
builtins No longer supported Not applicable in the Python 3 runtime. threadsafe No longer supported All applications are presumed to be threadsafe. If your application isn't threadsafe specify an entrypoint configuring 1 thread per worker.

For example, when using the F4 instance class:


entrypoint: gunicorn -b :$PORT -w 8 --threads 1 main:app

See entrypoint best practices for recommended number of workers for each instance class.

libraries No longer supported Use the requirements.txt file to declare dependencies and install client libraries. handlers: login Supported if app_engine_apis is true If you are not using the legacy bundled services for Python 3, use Identity and Access Management (IAM) for user management. handlers: script Modified In the Python 2 runtime, you use the script field to route incoming requests to your app's script.

In the Python 3 runtime, you are required to use a web framework with in-app routing (such as Flask or Django) instead of using the script field.

To migrate your app.yaml file to the Python 3 runtime, do one of the following, depending on whether the file contains static handlers as well as script handlers:

Static file handling remains unchanged.

If you use any of the deprecated fields, App Engine returns an error when you deploy your app.

You can use the following examples to compare the differences between the app.yaml files:

Python 2
runtime: python27
api_version: 1
threadsafe: true

handlers:
- url: /
  script: home.app

- url: /index\.html
  script: home.app

- url: /stylesheets
  static_dir: stylesheets

- url: /(.*\.(gif|png|jpg))$
  static_files: static/\1
  upload: static/.*\.(gif|png|jpg)$

- url: /admin/.*
  script: admin.app
  login: admin

- url: /.*
  script: not_found.app
Python 3
runtime: python313
app_engine_apis: true

handlers:
- url: /stylesheets
  static_dir: stylesheets

- url: /(.*\.(gif|png|jpg))$
  static_files: static/\1
  upload: static/.*\.(gif|png|jpg)$

- url: /admin/.*
  script: auto
  login: admin
Note: For Python 3 the preferred WSGI-compatible web server is gunicorn. When you use the optional entrypoint field in your app.yaml configuration file, the timeout for gunicorn defaults to 30 seconds. To set a custom timeout, update the entrypoint field: for example, entrypoint: gunicorn -b :$PORT --timeout=600. In this case, make sure you have included gunicorn in your requirements.txt file. Removing appengine_config.py

The Python 2 runtime in the App Engine standard environment uses the appengine_config.py file.

This file is ignored in the Python 3 runtime. Instead, the Python 3 runtime uses the standard requirements.txt file to install dependencies, including dependencies that use native code.

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-08-07 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-08-07 UTC."],[[["The Python 3 runtime on App Engine standard environment requires updates to the `app.yaml` file, while the `appengine_config.py` file is no longer used."],["Several fields in the `app.yaml` file are no longer supported in Python 3, including `api_version`, `application_readable`, `builtins`, `threadsafe`, and `libraries`, each having different changes in requirements or methodology."],["If using the legacy bundled services, the `app_engine_apis` field in `app.yaml` must be set to `true`, and it enables the use of `handlers: login`; otherwise, Identity and Access Management (IAM) should be used."],["In Python 3, the `script` field in `app.yaml` handlers is replaced by in-app routing using a web framework like Flask or Django, and the `entrypoint` field is used to start the web server, which will handle the routing."],["In the Python 3 runtime, dependencies are installed using the standard `requirements.txt` file instead of the `appengine_config.py` file used in Python 2, meaning the latter file can be removed."]]],[]]


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