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.
No comments:
Post a Comment