In the Google App Engine app.yaml
file, you specify a version
property (though the current preference instead of app.yaml: "...instead, use a command-line flag (--version
) to specify your version ID").
In my case, I use this for different environments. (See note at bottom) As documented in app.yaml
, unique version values produce unique URLs:
Note: Version names should begin with a letter, to distinguish them from numeric instances which are always specified by a number. This avoids the ambiguity with URLs like 123.my-service.appspot.com...
I use two versions, the first as my "QA environment" , the second as my "Production environment":
- dev
- 1
I want my code to set a variable is_prod
, and I want the value to be a boolean True
if the version value is equal to 'dev'. How can I do that?
*Note, as @Dan Cornilescu says in the comments, using-versions-for-environments may be a bad idea, per posts like this and this