Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Python, how can I test if I'm in Google App Engine SDK?

Whilst developing I want to handle some things slight differently than I will when I eventually upload to the Google servers.

Is there a quick test that I can do to find out if I'm in the SDK or live?

like image 478
user132262 Avatar asked Dec 16 '09 18:12

user132262


1 Answers

See: https://cloud.google.com/appengine/docs/python/how-requests-are-handled#Python_The_environment

The following environment variables are part of the CGI standard, with special behavior in App Engine: SERVER_SOFTWARE:

In the development web server, this value is "Development/X.Y" where "X.Y" is the version of the runtime.

When running on App Engine, this value is "Google App Engine/X.Y.Z".

like image 147
miku Avatar answered Sep 25 '22 10:09

miku