From 92191fb9d9f9d68811be81977faf108d9f1313f4 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 3e9f074d05c732c65cad104235807ed662a7df16 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 de5bb759e3b5f686769c0803541a555475b3ef5f 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 7777b06809a4fd948e86f5ce8681c8f401ff37ee 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 02e7bec21cec2f32d954e178a1a88f8dd6aaa81a 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 e429e47a967e6846fa6ef723364dd25cc9aea37b 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 29768ce45e6e46fd830d11f17250250fd8c5c5fb 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.