Google App Engine SDK – How to work out if you are running deployed or locally

Posted on June 3, 2008


Short post this one:

os.environ[‘SERVER_SOFTWARE’] is your variable to see.

  • Deployed, it reads ‘Google Apphosting/1.0’
  • Running locally, it reads ‘Development/1.0’

So doing “if os.environ[‘SERVER_SOFTWARE’].startswith(‘Development’):” should be enough to deal with the differences between local and deployed.

Posted in: Uncategorized