How do I get the Application ID at runtime
I need the Application ID to construct the correct <applicationid>.appspotmail.com
address, and I'm having a hard time f开发者_如何学编程inding out how to retrieve it at runtime.
The recommended approach now is to use app_identity.get_application_id()
:
http://code.google.com/appengine/docs/python/appidentity/functions.html#get_application_id
See the warning box here for details:
http://code.google.com/appengine/docs/python/runtime.html#Requests_and_Domains
You can get it using:
os.environ['APPLICATION_ID']
精彩评论