Thanks Felipe. Actually I was looking for another variable and found it at this link:
https://tamaskalman.com/blog/post/migrating-to-python-3-on-google-app-engine---part-5---finishing-touches-before-deploying-to-python-3 >From this, I took the following code and it seems to work on localhost. Will try to cloud next and see what happens. # module: appengine_config ... if os.getenv('GAE_ENV', '').startswith('standard'): pass else: Maybe, the GAE documentation team can consider adding this info to Python 3 guide as it is there in python 2.7 guide. Regards Sajal On Wednesday, December 22, 2021 at 2:50:35 PM UTC+5:30 [email protected] wrote: > If you're looking for the Python3 equivalent of that command, I believe I > found your answer here <https://stackoverflow.com/a/1857/15452572> > > In short, it's the *platform > <https://docs.python.org/3/library/platform.html>* library, *platform.system > <https://docs.python.org/3/library/platform.html#platform.system>* gives > the OS and *platform.release > <https://docs.python.org/3/library/platform.html#platform.release>* gives > the version. > Alternatively, there's the *os > <https://docs.python.org/3/library/os.html#os.name> *library and the *sys > <https://docs.python.org/3/library/sys.html#sys.platform>* library. > > On Wednesday, December 22, 2021 at 6:52:11 AM UTC+1 [email protected] > wrote: > >> Hi, >> >> Python 2,7 had the option to specify run time environment as follows: >> >> if os.getenv('SERVER_SOFTWARE', '').startswith('Google App Engine/'): >> # Production >> else: >> # Local development server >> >> The above does not seem to work in Python 3. Is there an equivalent in >> python 3 for the same? >> >> Thanks >> > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/aad62303-3a49-439f-98e2-bbc7812dd78en%40googlegroups.com.
