Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You could do a simple check against key environment variables. No telling exactly how reliable this might be, though.</p> <pre><code>import os, logging try: os.environ['APPENGINE_RUNTIME'] except KeyError: logging.warn('We are not in App Engine environment') else: logging.info('We are in the App Engine environment') </code></pre> <p>You can also <a href="https://developers.google.com/appengine/docs/python/config/appconfig#Defining_Environment_Variables" rel="nofollow">define your own custom environment variable in your App Engine configuration file</a> and that will be viewable from <code>os.environ</code> within any module. So, type something like this in your app.yaml file:</p> <pre><code>env_variables: MY_APP_ENGINE_ENVIRONMENT: '982844ed9cbd6ce42318d2804386be29cbc7c35a' </code></pre> <p>... will give you an unambiguous ID to reference.</p> <p>From the development server, here are the environment variables that I get:</p> <pre><code>{'USER_EMAIL': '', 'DATACENTER': 'us1', 'wsgi.version': (1, 0), 'REQUEST_ID_HASH': 'E2C19D51', 'SERVER_NAME': 'mydesktop', 'QUERY_STRING': '', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'APPENGINE_RUNTIME': 'python27', 'wsgi.input': &lt;cStringIO.StringI object at 0x2f145d0&gt;, 'SERVER_PROTOCOL': 'HTTP/1.1', 'HTTPS': 'off', 'USER_IS_ADMIN': '0', 'TZ': 'UTC', 'REMOTE_ADDR': '192.168.0.2', 'HTTP_X_APPENGINE_COUNTRY': 'ZZ', 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36', 'SERVER_SOFTWARE': 'Development/2.0', 'HTTP_CACHE_CONTROL': 'max-age=0', 'DEFAULT_VERSION_HOSTNAME': 'mydesktop:8080', 'SERVER_PORT': '8080', 'wsgi.run_once': False, 'REQUEST_METHOD': 'GET', 'USER_ID': '', 'AUTH_DOMAIN': 'gmail.com', 'USER_NICKNAME': '', 'USER_ORGANIZATION': '', 'wsgi.multiprocess': True, 'INSTANCE_ID': '8a8e02e6efa8d195346ae0c90cfeafce8aa2', 'PATH_INFO': '/', 'HTTP_ACCEPT_LANGUAGE': 'en-US,en;q=0.8', 'HTTP_HOST': 'mydesktop:8080', 'wsgi.errors': &lt;google.appengine.api.logservice.logservice.LogsBuffer object at 0x2f09c30&gt;, 'APPLICATION_ID': 'dev~myapp', 'wsgi.multithread': True, 'CURRENT_VERSION_ID': 'version-1', 'SCRIPT_NAME': '', 'REQUEST_LOG_ID': '4eafbc91ca4ebd5fee53f19eeab2eb26d243d9ddc92b6b9bc0a063eabdc84cfff', 'wsgi.url_scheme': 'http'} </code></pre> <p>Hope that helps.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload