Code sometimes needs to determine the identifier of the application in which it is executing. This may be to generate a URL or email address, or possibly to make some run-time decision. App Engine includes an Application Identity service for this purpose.
- Identifying itself
- Asserting identity to other App Engine apps
- Asserting identity to Google APIs
- Asserting identity to other systems
Identifying itself
Application ID
The application ID can be found using the
app_identity.get_application_id()
method. The WSGI or CGI environment exposes some implementation details which are handled by the API.
Versioned hostnames
A related operation is the need to get the hostname part of a URL to the application. You can use the
app_identity.get_default_version_hostname()
method for this purpose. This is useful in certain scenarios when the application is not available at
http://your_app_id.appspot.com
.