From 0cdfed66c9e5329437d1afb365d318dbafe4378b Mon Sep 17 00:00:00 2001 From: lord63 Date: Wed, 9 Jul 2014 13:22:27 +0800 Subject: [PATCH 1/7] Fix a typo in templating.rst --- docs/templating.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/templating.rst b/docs/templating.rst index bf672672..8b7caf44 100644 --- a/docs/templating.rst +++ b/docs/templating.rst @@ -119,7 +119,7 @@ Controlling Autoescaping ------------------------ Autoescaping is the concept of automatically escaping special characters -of you. Special characters in the sense of HTML (or XML, and thus XHTML) +for you. Special characters in the sense of HTML (or XML, and thus XHTML) are ``&``, ``>``, ``<``, ``"`` as well as ``'``. Because these characters carry specific meanings in documents on their own you have to replace them by so called "entities" if you want to use them for text. Not doing so From 5b1aa3852f4809044b7b081a5795d416d4959f91 Mon Sep 17 00:00:00 2001 From: lord63 Date: Wed, 9 Jul 2014 14:22:30 +0800 Subject: [PATCH 2/7] Update becomingbig.rst --- docs/becomingbig.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/becomingbig.rst b/docs/becomingbig.rst index 62f456bd..8b0a2743 100644 --- a/docs/becomingbig.rst +++ b/docs/becomingbig.rst @@ -12,7 +12,7 @@ Flask started in part to demonstrate how to build your own framework on top of existing well-used tools Werkzeug (WSGI) and Jinja (templating), and as it developed, it became useful to a wide audience. As you grow your codebase, don't just use Flask -- understand it. Read the source. Flask's code is -written to be read; it's documentation published so you can use its internal +written to be read; it's documentation is published so you can use its internal APIs. Flask sticks to documented APIs in upstream libraries, and documents its internal utilities so that you can find the hook points needed for your project. From 1fab3fc49b03ec78825d03dcb271bcff7c923906 Mon Sep 17 00:00:00 2001 From: lord63 Date: Wed, 9 Jul 2014 14:45:55 +0800 Subject: [PATCH 3/7] Fix typos in shell.rst --- docs/shell.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/shell.rst b/docs/shell.rst index f4522c1a..55a428c7 100644 --- a/docs/shell.rst +++ b/docs/shell.rst @@ -94,10 +94,10 @@ Further Improving the Shell Experience -------------------------------------- If you like the idea of experimenting in a shell, create yourself a module -with stuff you want to star import into your interactive session. There +with stuff you want to firstly import into your interactive session. There you could also define some more helper methods for common things such as initializing the database, dropping tables etc. -Just put them into a module (like `shelltools` and import from there): +Just put them into a module (like `shelltools`) and import from there: >>> from shelltools import * From b8c652603ca9d2effb184da10f8b4f47f58abcbd Mon Sep 17 00:00:00 2001 From: lord63 Date: Thu, 10 Jul 2014 12:04:48 +0800 Subject: [PATCH 4/7] Fix a typo in config.rst --- docs/config.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/config.rst b/docs/config.rst index d0e1bcdb..e5b2369b 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -7,7 +7,7 @@ Configuration Handling Applications need some kind of configuration. There are different settings you might want to change depending on the application environment like -toggling the debug mode, setting the secret key, and other such +toggling the debug mode, setting the secret key, and other such as environment-specific things. The way Flask is designed usually requires the configuration to be From b4e291257b37f87ab0e88e887af02a5c6e0ade85 Mon Sep 17 00:00:00 2001 From: lord63 Date: Fri, 11 Jul 2014 23:23:01 +0800 Subject: [PATCH 5/7] Fix typos in config.rst --- docs/config.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/config.rst b/docs/config.rst index e5b2369b..6bece190 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -10,7 +10,7 @@ you might want to change depending on the application environment like toggling the debug mode, setting the secret key, and other such as environment-specific things. -The way Flask is designed usually requires the configuration to be +The way Flask designed usually requires the configuration to be available when the application starts up. You can hardcode the configuration in the code, which for many small applications is not actually that bad, but there are better ways. @@ -194,7 +194,7 @@ The following configuration values are used internally by Flask: browsers will not allow cross-subdomain cookies to be set on a server name without dots in it. So if your server name is ``'localhost'`` you will not be able to set a cookie for - ``'localhost'`` and every subdomain of it. Please chose a different + ``'localhost'`` and every subdomain of it. Please choose a different server name in that case, like ``'myapplication.local'`` and add this name + the subdomains you want to use into your host config or setup a local `bind`_. @@ -249,7 +249,7 @@ So a common pattern is this:: This first loads the configuration from the `yourapplication.default_settings` module and then overrides the values with the contents of the file the :envvar:`YOURAPPLICATION_SETTINGS` -environment variable points to. This environment variable can be set on +environment variable pointing to. This environment variable can be set on Linux or OS X with the export command in the shell before starting the server:: @@ -287,7 +287,7 @@ a little harder. There is no single 100% solution for this problem in general, but there are a couple of things you can keep in mind to improve that experience: -1. create your application in a function and register blueprints on it. +1. Create your application in a function and register blueprints on it. That way you can create multiple instances of your application with different configurations attached which makes unittesting a lot easier. You can use this to pass in configuration as needed. @@ -348,10 +348,10 @@ To enable such a config you just have to call into There are many different ways and it's up to you how you want to manage your configuration files. However here a list of good recommendations: -- keep a default configuration in version control. Either populate the +- Keep a default configuration in version control. Either populate the config with this default configuration or import it in your own configuration files before overriding values. -- use an environment variable to switch between the configurations. +- Use an environment variable to switch between the configurations. This can be done from outside the Python interpreter and makes development and deployment much easier because you can quickly and easily switch between different configs without having to touch the From cab4ec641f0bff3151ac3f4433d91274498af3d5 Mon Sep 17 00:00:00 2001 From: lord63 Date: Sat, 26 Jul 2014 20:15:36 +0800 Subject: [PATCH 6/7] Correct the mistakes. --- docs/config.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/config.rst b/docs/config.rst index 6bece190..660f6ca5 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -7,10 +7,10 @@ Configuration Handling Applications need some kind of configuration. There are different settings you might want to change depending on the application environment like -toggling the debug mode, setting the secret key, and other such as +toggling the debug mode, setting the secret key, and other such environment-specific things. -The way Flask 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 hardcode the configuration in the code, which for many small applications is not actually that bad, but there are better ways. @@ -249,7 +249,7 @@ So a common pattern is this:: This first loads the configuration from the `yourapplication.default_settings` module and then overrides the values with the contents of the file the :envvar:`YOURAPPLICATION_SETTINGS` -environment variable pointing to. This environment variable can be set on +environment variable points to. This environment variable can be set on Linux or OS X with the export command in the shell before starting the server:: From e24eae01690bb3723b149395c30233e9a9d54da9 Mon Sep 17 00:00:00 2001 From: lord63 Date: Sat, 26 Jul 2014 22:43:52 +0800 Subject: [PATCH 7/7] Correct the mistake again. --- docs/shell.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/shell.rst b/docs/shell.rst index 55a428c7..f622be9d 100644 --- a/docs/shell.rst +++ b/docs/shell.rst @@ -94,7 +94,7 @@ Further Improving the Shell Experience -------------------------------------- If you like the idea of experimenting in a shell, create yourself a module -with stuff you want to firstly import into your interactive session. There +with stuff you want to star import into your interactive session. There you could also define some more helper methods for common things such as initializing the database, dropping tables etc.