/docs/envvariables.txt
Plain Text | 66 lines | 46 code | 20 blank | 0 comment | 0 complexity | e4f1f6438fd0ece6ca297e53def468fb MD5 | raw file
1Environmental Variables 2======================= 3 4This document describes all the environmental variables that Silver 5Lining creates, that an application might want to use (or just might 6notice). 7 8``SILVER_VERSION``: 9 10 This gives the version in the form ``context/version``, like 11 ``silverlining/0.0`` or ``devel/0.0``. Having not had a release, 12 there is no real version information yet, but this can be used to 13 detect the difference between production and development 14 environments. (Also ``silversupport.env.is_production()`` does 15 this.) 16 17``SILVER_INSTANCE_NAME``: 18 19 This is the name of the instance/deployment. 20 21``SILVER_MATCH_PATH``: 22 23 This is the portion of the path that was matched during dispatch. 24 For instance if you upload an app to ``site.example.com/blog`` 25 then ``SILVER_MATCH_PATH`` will be ``/blog``. 26 27``SILVER_APP_NAME``: 28 29 This is the name of the application. If ``SILVER_INSTANCE_NAME`` is 30 ``blog.20100319_004`` then this will probably be ``blog``. 31 32``SILVER_APP_CONFIG``: 33 34 This is a directory that contains the application's configuration 35 (as uploaded using ``silver update --config DIR``). 36 37``SILVER_CANONICAL_HOSTNAME``: 38 39 This is what *might* be considered the "canonical" (i.e., main) 40 hostname of the application. This is calculated as the *shortest* 41 hostname possible. When only one hostname is mapped to an 42 application this is always correct. 43 44``SILVER_LOGS``: 45 46 This is a directory where log files should be kept. This is a 47 per-application directory. In development it will be in 48 ``silver-logs/`` under your application's main directory (what you 49 created with ``silver init``). 50 51``CONFIG_*``: 52 53 This is the naming convention for all the information coming from 54 services. 55 56``TEMP``: 57 58 This points to a place to put "temporary" files. These are files 59 that don't have to exist forever (the ``service.files`` service 60 and ``CONFIG_FILES`` should be used for such files), but is a good 61 place to put cache files. You can also keep files in ``/tmp`` but 62 using ``TEMP`` is more cleanly. Some modules like `tempfile 63 <http://docs.python.org/library/tempfile.html>`_ will 64 automatically look at this variable. 65 66 This directory is cleared everytime the application is uploaded.