app_id = os.environ['APPLICATION_ID']
path = os.environ['PATH_TRANSLATED']
path_parts = path.split(app_id, 1)
root_path = path_parts[0] + app_id
if not os.environ['SERVER_SOFTWARE'].startswith('Dev'):
    root_path += '/' + path_parts[1].lstrip('/').split('/', 1)[0]
return root_path
How to get application root path in GAE