summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfredo Deza <alfredodeza@gmail.com>2010-12-09 17:02:35 -0500
committerAlfredo Deza <alfredodeza@gmail.com>2010-12-09 17:02:35 -0500
commitdc4d05e3a20b74ba6859cfe8d60f8ef3dca51934 (patch)
tree8e0fda21ada40a43d46ec6faa1080928db07f60f
parent7b73da6db302da44b7237622b2f6b03541e20116 (diff)
downloadpecan-dc4d05e3a20b74ba6859cfe8d60f8ef3dca51934.tar.gz
added a couple more sections and started working on Server configuration specific stuff
-rw-r--r--docs/0.0.1/source/configuration.rst31
1 files changed, 31 insertions, 0 deletions
diff --git a/docs/0.0.1/source/configuration.rst b/docs/0.0.1/source/configuration.rst
index 1db79a4..0881bfe 100644
--- a/docs/0.0.1/source/configuration.rst
+++ b/docs/0.0.1/source/configuration.rst
@@ -75,3 +75,34 @@ top of the file. In the example configuration, this would be something like::
**debug** Enables ``WebError`` to have full tracebacks in the browser (this is
OFF by default).
+Any application specifics should go in here in the case that your environment
+required it.
+
+
+Accessibility
+--------------
+You can access any configuration values at runtime importing ``conf`` from
+``pecan``. This includes custom, application and server specific values.
+Below is an example on how to access those values for an application::
+
+ >>> from pecan import conf
+ >>> conf.app.root
+ <test_project.controllers.root.RootController object at 0x10292b0d0>
+ >>> conf.app.static_root
+ 'public'
+ >>> conf.app.template_path
+ 'test_project/templates'
+ >>> conf.app.debug
+ True
+
+Similarly, if I had a custom ``foo`` entry on my configuration file once the
+app is running I can access ``foo`` values like::
+
+ >>> from pecan import conf
+ >>> conf.foo.bar
+ True
+ >>> conf.foo.baz
+ False
+ >>> conf.foo
+ Config({'bar': True, 'baz': False})
+