In Python, how can I test if I'm in Google App Engine SDK?

前端 未结 6 1954
忘了有多久
忘了有多久 2020-11-27 05:19

Whilst developing I want to handle some things slight differently than I will when I eventually upload to the Google servers.

Is there a quick test that I can do to

6条回答
  •  星月不相逢
    2020-11-27 06:09

    See: https://cloud.google.com/appengine/docs/python/how-requests-are-handled#Python_The_environment

    The following environment variables are part of the CGI standard, with special behavior in App Engine: SERVER_SOFTWARE:

    In the development web server, this value is "Development/X.Y" where "X.Y" is the version of the runtime.

    When running on App Engine, this value is "Google App Engine/X.Y.Z".

提交回复
热议问题