Browse Source

Minor config documentation fixes (grammar, etc)

pull/112/head
Adam Zapletal 15 years ago committed by Armin Ronacher
parent
commit
24754114fc
  1. 14
      docs/config.rst

14
docs/config.rst

@ -6,12 +6,12 @@ Configuration Handling
.. versionadded:: 0.3 .. versionadded:: 0.3
Applications need some kind of configuration. There are different things Applications need some kind of configuration. There are different things
you might want to change. Like toggling debug mode, the secret key and a you might want to change like toggling debug mode, the secret key, and a
lot of very similar things. lot of very similar things.
The way Flask is designed usually requires the configuration to be The way Flask is designed usually requires the configuration to be
available when the application starts up. You can either hardcode the available when the application starts up. You can hardcode the
configuration in the code which for many small applications is not configuration in the code, which for many small applications is not
actually that bad, but there are better ways. actually that bad, but there are better ways.
Independent of how you load your config, there is a config object Independent of how you load your config, there is a config object
@ -64,8 +64,8 @@ The following configuration values are used internally by Flask:
Configuring from Files Configuring from Files
---------------------- ----------------------
Configuration becomes more useful if you can configure from a file. And Configuration becomes more useful if you can configure from a file, and
ideally that file would be outside of the actual application package that ideally that file would be outside of the actual application package so that
you can install the package with distribute (:ref:`distribute-deployment`) you can install the package with distribute (:ref:`distribute-deployment`)
and still modify that file afterwards. and still modify that file afterwards.
@ -75,7 +75,7 @@ So a common pattern is this::
app.config.from_object('yourapplication.default_settings') app.config.from_object('yourapplication.default_settings')
app.config.from_envvar('YOURAPPLICATION_SETTINGS') app.config.from_envvar('YOURAPPLICATION_SETTINGS')
What this does is first loading the configuration from the This first loads the configuration from the
`yourapplication.default_settings` module and then overrides the values `yourapplication.default_settings` module and then overrides the values
with the contents of the file the :envvar:`YOURAPPLICATION_SETTINGS` with the contents of the file the :envvar:`YOURAPPLICATION_SETTINGS`
environment variable points to. This environment variable can be set on environment variable points to. This environment variable can be set on
@ -95,7 +95,7 @@ The configuration files themselves are actual Python files. Only values
in uppercase are actually stored in the config object later on. So make in uppercase are actually stored in the config object later on. So make
sure to use uppercase letters for your config keys. sure to use uppercase letters for your config keys.
Here an example configuration file:: Here is an example configuration file::
DEBUG = False DEBUG = False
SECRET_KEY = '?\xbf,\xb4\x8d\xa3"<\x9c\xb0@\x0f5\xab,w\xee\x8d$0\x13\x8b83' SECRET_KEY = '?\xbf,\xb4\x8d\xa3"<\x9c\xb0@\x0f5\xab,w\xee\x8d$0\x13\x8b83'

Loading…
Cancel
Save