Python 2.7 has reached end of support
and will be deprecated
on January 31, 2026. After deprecation, you won't be able to deploy Python 2.7
applications, even if your organization previously used an organization policy to
re-enable deployments of legacy runtimes. Your existing Python
2.7 applications will continue to run and receive traffic after their
deprecation date. We recommend that
you migrate to the latest supported version of Python.
Stay organized with collections
Save and categorize content based on your preferences.
The local development server (dev_appserver.py) is part of the App Engine
components of the gcloud CLI. This topic provides advanced
information about the dev_appserver.py usage.
See Using the Local Development Server
for more information about local testing.
Set up the local development server tool
A sample dev_appserver.py command might look as follows:
DEVAPPSERVER_ROOT with the path to the root directory
where you extract the archived version of devapp_server.py. For more information about
downloading and using the archived version of dev_appserver.py, see Using the local development server.
OPTION with a flag supported by the local development
server.
FILES specifies one or more app.yaml files, one per
service, for the positional argument yaml_path.
For a complete list of options, run the following:
Host name to which the local development server's administration console
should bind (default: localhost).
--admin_port=ADMIN_PORT
Port to which the local development server's administration console should
bind (default: 8000).
--enable_sendmail=yes|no
Uses the local computer's Sendmail installation for
sending email messages.
--enable_task_running=yes|no
Enables the development server to run push tasks. The default is yes.
If you specify no, the server will not run push tasks.
--help
Prints a helpful message then quits.
--host=...
The host address to use for the server. You may need to set this to be able
to access the development server from another computer on your network. An
address of 0.0.0.0 allows both localhost access and IP or hostname access.
Default is localhost.
--log_level=...
The lowest logging level at which logging messages will be written to the
console; messages of the specified logging level or higher will be output.
Possible values are debug, info, warning, error, and critical.
--port=...
The port number to use for the server. Default is 8080. If multiple servers
are launched such as for services, they will be assigned subsequent ports,
such as 8081, 8082.
--logs_path=...
By default, the logs for the local development server are stored in memory
only. Specify this option when you run the local development server to store
the logs into a file, which makes the logs available across server restarts.
You must specify the directory path and name to a SQLite database file. A
SQLite database file is created with the specified name if the file does not
already exist. For example: --logs_path=/home/logs/boglogs.db
--require_indexes=yes|no
Disables automatic generation of entries in the index.yaml file. Instead,
when the application makes a query that requires that its index be defined in
the file and the index definition is not found, an exception will be raised,
similar to what would happen when running on App Engine. The default value is
no.
--runtime_python_path=...
The path to your Python 3 binary. To run a Python 3 app on the
dev_appserver, specify this flag.
--smtp_host=...
The hostname of the SMTP server to use for sending email messages.
--smtp_port=...
The port number of the SMTP server to use for sending email messages.
--smtp_user=...
The username to use with the SMTP server for sending email messages.
--smtp_password=...
The password to use with the SMTP server for sending email messages.
--storage_path=...
Path at which all local files, such as the Datastore,
Blobstore, Cloud Storage files and logs, will be stored, unless
overridden by --datastore_path, --blobstore_path, or --logs_path.
--support_datastore_emulator=yes|no
Use the Cloud Datastore Emulator (beta) for local datastore emulation.
--datastore_emulator_port=...
The port number to use for Cloud Datastore Emulator (beta).
--env_var=...
User defined environment variable for the local runtime process. Each
env_var is in the format of key=value, and you can define multiple
environment variables. In addition to env_variables in the app.yaml, this
flag allows setting extra environment variables for local processes.
For example:--env_var KEY_1=val1 --env_var KEY_2=val2
[[["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-25 UTC."],[[["\u003cp\u003eThe \u003ccode\u003edev_appserver.py\u003c/code\u003e is a local development server tool within the App Engine components of the gcloud CLI, providing advanced options for local development.\u003c/p\u003e\n"],["\u003cp\u003eBefore running \u003ccode\u003edev_appserver.py\u003c/code\u003e, users must ensure they have followed the setup instructions and use Python 3, while also setting the \u003ccode\u003eCLOUDSDK_DEVAPPSERVER_PYTHON\u003c/code\u003e environment variable to their Python 2 interpreter's path.\u003c/p\u003e\n"],["\u003cp\u003eA typical \u003ccode\u003edev_appserver.py\u003c/code\u003e command includes specifying the path to the tool, any desired options, and the \u003ccode\u003eapp.yaml\u003c/code\u003e file(s) for the service(s).\u003c/p\u003e\n"],["\u003cp\u003eCommon options for \u003ccode\u003edev_appserver.py\u003c/code\u003e include configuring admin and server hosts and ports, enabling email and task sending, setting log levels, specifying storage paths for local files, and using the Cloud Datastore Emulator.\u003c/p\u003e\n"],["\u003cp\u003eRunning the \u003ccode\u003edev_appserver.py -h\u003c/code\u003e command will display a complete list of options.\u003c/p\u003e\n"]]],[],null,["# Local Development Server Options\n\nThe local development server (`dev_appserver.py`) is part of the App Engine\ncomponents of the [gcloud CLI](/sdk/docs). This topic provides advanced\ninformation about the `dev_appserver.py` usage.\n\n\nSee [Using the Local Development Server](/appengine/docs/legacy/standard/python/tools/using-local-server)\nfor more information about local testing.\n\n\nSet up the local development server tool\n----------------------------------------\n\n| **Important:**\n| - Before running the local development server, follow the [setup instructions](/appengine/docs/legacy/standard/python/tools/using-local-server#set-up). Regardless of your app's runtime or language version, you must run `dev_appserver.py` with Python 3 and set the `CLOUDSDK_DEVAPPSERVER_PYTHON` environment variable in your shell to the path of your Python 2 interpreter.\n| - The `dev_appserver` tool does not support development of Python 3 apps on Windows.\n\nA sample `dev_appserver.py` command might look as follows: \n\n python2 \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eDEVAPPSERVER_ROOT\u003c/span\u003e\u003c/var\u003e/google_appengine/dev_appserver.py \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eOPTION\u003c/span\u003e\u003c/var\u003e yaml_path \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eFILES\u003c/span\u003e\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eDEVAPPSERVER_ROOT\u003c/var\u003e with the path to the root directory where you extract the archived version of `devapp_server.py`. For more information about downloading and using the archived version of `dev_appserver.py`, see [Using the local development server](/appengine/docs/legacy/standard/python/tools/using-local-server#before_you_begin).\n- \u003cvar translate=\"no\"\u003eOPTION\u003c/var\u003e with a flag supported by the local development server.\n- \u003cvar translate=\"no\"\u003eFILES\u003c/var\u003e specifies one or more `app.yaml` files, one per service, for the positional argument `yaml_path`.\n\nFor a complete list of options, run the following:\n\n\u003cvar translate=\"no\"\u003eDEVAPPSERVER_ROOT\u003c/var\u003e/google_appengine/dev_appserver.py -h\n\nCommon options\n--------------\n\nThe most common options are as follows:\n\n`--admin_host=ADMIN_HOST`\n: Host name to which the local development server's administration console\n should bind (default: localhost).\n\n`--admin_port=ADMIN_PORT`\n: Port to which the local development server's administration console should\n bind (default: 8000).\n\n`--enable_sendmail=yes|no`\n: Uses the local computer's Sendmail installation for\n sending email messages.\n\n`--enable_task_running=yes|no`\n: Enables the development server to run push tasks. The default is `yes`.\n If you specify `no`, the server will not run push tasks.\n\n`--help`\n: Prints a helpful message then quits.\n\n`--host=...`\n: The host address to use for the server. You may need to set this to be able\n to access the development server from another computer on your network. An\n address of `0.0.0.0` allows both localhost access and IP or hostname access.\n Default is `localhost`.\n\n`--log_level=...`\n: The lowest logging level at which logging messages will be written to the\n console; messages of the specified logging level or higher will be output.\n Possible values are `debug`, `info`, `warning`, `error`, and `critical`.\n\n`--port=...`\n: The port number to use for the server. Default is `8080`. If multiple servers\n are launched such as for services, they will be assigned subsequent ports,\n such as `8081`, `8082`.\n\n`--logs_path=...`\n: By default, the logs for the local development server are stored in memory\n only. Specify this option when you run the local development server to store\n the logs into a file, which makes the logs available across server restarts.\n You must specify the directory path and name to a SQLite database file. A\n SQLite database file is created with the specified name if the file does not\n already exist. For example: `--logs_path=/home/logs/boglogs.db`\n\n`--require_indexes=yes|no`\n: Disables automatic generation of entries in the `index.yaml` file. Instead,\n when the application makes a query that requires that its index be defined in\n the file and the index definition is not found, an exception will be raised,\n similar to what would happen when running on App Engine. The default value is\n `no`.\n\n`--runtime_python_path=...`\n: The path to your Python 3 binary. To run a Python 3 app on the\n `dev_appserver`, specify this flag.\n\n`--smtp_host=...`\n: The hostname of the SMTP server to use for sending email messages.\n\n`--smtp_port=...`\n: The port number of the SMTP server to use for sending email messages.\n\n`--smtp_user=...`\n: The username to use with the SMTP server for sending email messages.\n\n`--smtp_password=...`\n: The password to use with the SMTP server for sending email messages.\n\n`--storage_path=...`\n: Path at which all local files, such as the Datastore,\n Blobstore, Cloud Storage files and logs, will be stored, unless\n overridden by `--datastore_path`, `--blobstore_path`, or `--logs_path`.\n\n`--support_datastore_emulator=yes|no`\n: Use the Cloud Datastore Emulator (beta) for local datastore emulation.\n\n`--datastore_emulator_port=...`\n: The port number to use for Cloud Datastore Emulator (beta).\n\n`--env_var=...`\n: User defined environment variable for the local runtime process. Each\n `env_var` is in the format of key=value, and you can define multiple\n environment variables. In addition to `env_variables` in the `app.yaml`, this\n flag allows setting extra environment variables for local processes.\n For example:`--env_var KEY_1=val1 --env_var KEY_2=val2`"]]