Skip to content
Myr

Fix typos in config.rst

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by lord63 · committed by lord63 · parent 7777b06 · Browse files · 1 file+6 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−6 removed

  • other:+6 added−6 removed

1 file+6 added−6 removed

modified:docs/config.rst+6 added-6 removed
8 unmodified lines
9you might want to change depending on the application environment like10toggling the debug mode, setting the secret key, and other such as11environment-specific things.1213The way Flask is designed usually requires the configuration to be13The way Flask designed usually requires the configuration to be14available when the application starts up. You can hardcode the15configuration in the code, which for many small applications is not16actually that bad, but there are better ways.17
175 unmodified lines
193 what subdomains are, your web browser does as well. Most modern web194 browsers will not allow cross-subdomain cookies to be set on a195 server name without dots in it. So if your server name is196 ``'localhost'`` you will not be able to set a cookie for197 ``'localhost'`` and every subdomain of it. Please chose a different197 ``'localhost'`` and every subdomain of it. Please choose a different198 server name in that case, like ``'myapplication.local'`` and add199 this name + the subdomains you want to use into your host config200 or setup a local `bind`_.201
46 unmodified lines
248249This first loads the configuration from the250`yourapplication.default_settings` module and then overrides the values251with the contents of the file the :envvar:`YOURAPPLICATION_SETTINGS`252environment variable points to. This environment variable can be set on252environment variable pointing to. This environment variable can be set on253Linux or OS X with the export command in the shell before starting the254server::255256 $ export YOURAPPLICATION_SETTINGS=/path/to/settings.cfg
29 unmodified lines
286a little harder. There is no single 100% solution for this problem in287general, but there are a couple of things you can keep in mind to improve288that experience:2892901. create your application in a function and register blueprints on it.2901. Create your application in a function and register blueprints on it.291 That way you can create multiple instances of your application with292 different configurations attached which makes unittesting a lot293 easier. You can use this to pass in configuration as needed.294
52 unmodified lines
347348There are many different ways and it's up to you how you want to manage349your configuration files. However here a list of good recommendations:350351- keep a default configuration in version control. Either populate the351- Keep a default configuration in version control. Either populate the352 config with this default configuration or import it in your own353 configuration files before overriding values.354- use an environment variable to switch between the configurations.354- Use an environment variable to switch between the configurations.355 This can be done from outside the Python interpreter and makes356 development and deployment much easier because you can quickly and357 easily switch between different configs without having to touch the358 code at all. If you are working often on different projects you can
92 unmodified lines