diff options
author | Alfredo Deza <alfredodeza@gmail.com> | 2010-12-09 17:02:35 -0500 |
---|---|---|
committer | Alfredo Deza <alfredodeza@gmail.com> | 2010-12-09 17:02:35 -0500 |
commit | dc4d05e3a20b74ba6859cfe8d60f8ef3dca51934 (patch) | |
tree | 8e0fda21ada40a43d46ec6faa1080928db07f60f | |
parent | 7b73da6db302da44b7237622b2f6b03541e20116 (diff) | |
download | pecan-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.rst | 31 |
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}) + |