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
We recommend that you use standard Python tools, such as
virtualenv to create isolated environments and
to run unit tests and integration tests, rather than depending on
dev_appserver, the local development server provided
with the Google Cloud SDK.
See Using the Local Development
more information about local testing.
If Python 2 is not the default interpreter on your system, you need to run
python2 dev_appserver.py to ensure the Python 2 interpreter is used, as follows:
dev_appserver.py [options] yaml_path [files...]
The positional argument
yaml_path specifies one or more
app.yaml files, one
For a complete list of options, type:
The most common options are described here.
- Host name to which the local development server's administration console should bind (default: localhost).
- Port to which the local development server's administration console should bind (default: 8000).
- Uses the local computer's Sendmail installation for sending email messages.
- Prints a helpful message then quits.
- 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
0.0.0.0allows both localhost access and IP or hostname access. Default is
- 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
- 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
- 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:
- Disables automatic generation of entries in the
index.yamlfile. 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
- The path to your Python 3 binary. To run a Python 3 app on the
dev_appserver, specify this flag.
- The hostname of the SMTP server to use for sending email messages.
- The port number of the SMTP server to use for sending email messages.
- The username to use with the SMTP server for sending email messages.
- The password to use with the SMTP server for sending email messages.
- Path at which all local files, such as the Datastore,
Blobstore, Cloud Storage files and logs, will be stored, unless
- Use the Cloud Datastore Emulator (beta) for local datastore emulation.
- The port number to use for Cloud Datastore Emulator (beta).
- User defined environment variable for the local runtime process. Each
env_varis in the format of key=value, and you can define multiple environment variables. In addition to
app.yaml, this flag allows setting extra environment variables for local processes. For example:
--env_var KEY_1=val1 --env_var KEY_2=val2