Please see this page:
https://cloud.google.com/appengine/docs/standard/python/tools/using-local-server

On this page, you can check the section on detecting application run time
environment.

I am suggesting that similar section be added for python 3 local
development server page with the python 3 related key value.

Regards

On Fri, 24 Dec 2021 at 7:51 PM 'Felipe Bergallo Corral' via Google App
Engine <google-appengine@googlegroups.com> wrote:

> In which document is this found? Asking so I can report this if that's the
> case (and if there isn't already a feature request for this to be included,
> which I'd be surprised if there wasn't)
>
> On Thursday, December 23, 2021 at 8:33:53 AM UTC+1 sa...@visiblebox.com
> wrote:
>
>> 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
>> bergall...@google.com 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 sa...@visiblebox.com
>>> 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 a topic in the
> Google Groups "Google App Engine" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/google-appengine/EpFWzENvdSs/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> google-appengine+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-appengine/6ff931e6-edb5-4330-a3db-104ad1aec35fn%40googlegroups.com
> <https://groups.google.com/d/msgid/google-appengine/6ff931e6-edb5-4330-a3db-104ad1aec35fn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 google-appengine+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/CAKBM6m2UBmJBXWeaqjVayQWYqfQHU9eaKCkrn4OEB4gVLtz4_w%40mail.gmail.com.

Reply via email to