Environmental Variables ======================= This document describes all the environmental variables that Silver Lining creates, that an application might want to use (or just might notice). ``SILVER_VERSION``: This gives the version in the form ``context/version``, like ``silverlining/0.0`` or ``devel/0.0``. Having not had a release, there is no real version information yet, but this can be used to detect the difference between production and development environments. (Also ``silversupport.env.is_production()`` does this.) ``SILVER_INSTANCE_NAME``: This is the name of the instance/deployment. ``SILVER_MATCH_PATH``: This is the portion of the path that was matched during dispatch. For instance if you upload an app to ``site.example.com/blog`` then ``SILVER_MATCH_PATH`` will be ``/blog``. ``SILVER_APP_NAME``: This is the name of the application. If ``SILVER_INSTANCE_NAME`` is ``blog.20100319_004`` then this will probably be ``blog``. ``SILVER_APP_CONFIG``: This is a directory that contains the application's configuration (as uploaded using ``silver update --config DIR``). ``SILVER_CANONICAL_HOSTNAME``: This is what *might* be considered the "canonical" (i.e., main) hostname of the application. This is calculated as the *shortest* hostname possible. When only one hostname is mapped to an application this is always correct. ``SILVER_LOGS``: This is a directory where log files should be kept. This is a per-application directory. In development it will be in ``silver-logs/`` under your application's main directory (what you created with ``silver init``). ``CONFIG_*``: This is the naming convention for all the information coming from services. ``TEMP``: This points to a place to put "temporary" files. These are files that don't have to exist forever (the ``service.files`` service and ``CONFIG_FILES`` should be used for such files), but is a good place to put cache files. You can also keep files in ``/tmp`` but using ``TEMP`` is more cleanly. Some modules like `tempfile <http://docs.python.org/library/tempfile.html>`_ will automatically look at this variable. This directory is cleared everytime the application is uploaded.