gaetk2.config module¶
Framework Configuration¶
gaetk2 expects it information to be found in gaetk2_config.py
.
Minimal content is:
GAETK2_SECRET='*some random value*'
GAETK2_SECRET
is used for Session generation etc. Try something like (dd if=/dev/urandom count=1000 ) | shasum
to get a nice value for GAETK2_SECRET.
Todo
Document other configuration values.
Runtime Information¶
The functions get_environment()
,
get_release()
and
get_revision()
allow the caller to find out about
the deployment.
Runtime Configuration¶
get_config()
and set_config()
allow
you to set datastore backed configration values. These are saved via gaetk_Configuration
. NDB caching applies so keep in mind that changing
the values in the datastore via the Google App Engine Admin Console does not update this cache.
Todo
Document the view to change runtime configuration values.
Module contents¶
-
gaetk2.config.
get_release
(*args, **kwds)[source]¶ Get the tagged version of the current deployment.
Which usually means the first linegaetk2-release.txt
. E.g.v180228-cg89bd1-production-dot-application.appspot.com
.Results are cached locally (maxsize=1 ttl=43200)
-
gaetk2.config.
get_revision
(*args, **kwds)[source]¶ Get the git SHA1 revision of the current deployment.
Get the first line ofgaetk2-revision.txt
. E.g.14006259d78fa918054f774d20480b52e38c4707
.Results are cached locally (maxsize=1 ttl=43200)
-
gaetk2.config.
get_userversion
(*args, **kwds)[source]¶ Return the User-Visible Version (eg 2018.11.3).
Results are cached locally (maxsize=1 ttl=43200)
-
gaetk2.config.
get_environment
()[source]¶ Returns
production
,staging
,testing
ordevelopment
depending on the Server Name.See production version, staging version, testing version, and production version for meaning.
-
gaetk2.config.
is_production
()[source]¶ checks if we can assume to run on a production version instance.
… unless called by the resttest-client. See production version what this means.
There are suble differences to
get_environment()
- read the code for details.