views:

51

answers:

1

Hi,

I have a Google App engine application that I want to work differently depending upon if it is running in my local dev environment (i.e. with dev_appserver.py) as against running in actual GAE cloud.

Currently I use a flag variable that I manually toggle to achieve that. But I am sure one day I will forget to change it and will lead to problem. So I would like to know if there is an API or some other way to figure out where the GAE app is actually running?

Thanks.

+4  A: 

You could check the SERVER_SOFTWARE environment variable to see if it is Development/X or Google App Engine/X:

http://code.google.com/appengine/docs/python/runtime.html#The_Environment

Saxon Druce