Fix some typos in the docs
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by jgraeme · committed by Armin Ronacher · parent 41f5ad9 · Browse files · 4 files·+9 added−9 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Trailers
- Signed-off-by: Armin Ronacher <armin.ronacher@active-4.com>
Diff stats
4 files+9 added−9 removed
- other:+9 added−9 removed
Provenance
- Commit
540eca1- Tree
5afe030- Author
jgraeme <jgraeme+git@gmail.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent
41f5ad9
4 files changed+9 added−9 removed
modified:docs/patterns/appfactories.rst+1 added-1 removed
2 unmodified lines3 Application Factories4 =====================5 6 If you are already using packages and modules for your application7-(:ref:`packages`) there are couple of really nice ways to further improve7+(:ref:`packages`) there are a couple of really nice ways to further improve8 the experience. A common pattern is creating the application object when9 the module is imported. But if you move the creation of this object,10 into a function, you can then create multiple instances of this and later.11 64 unmodified linesmodified:docs/patterns/index.rst+2 added-2 removed
1 unmodified line2 3 Patterns for Flask4 ==================5 6-Certain things are common enough that the changes are high you will find6+Certain things are common enough that the chances are high you will find7 them in most web applications. For example quite a lot of applications8 are using relational databases and user authentication. In that case,9-changes are they will open a database connection at the beginning of the9+chances are they will open a database connection at the beginning of the10 request and get the information of the currently logged in user. At the11 end of the request, the database connection is closed again.12 13 There are more user contributed snippets and patterns in the `Flask19 unmodified linesmodified:docs/patterns/packages.rst+5 added-5 removed
57 unmodified lines58 decorator on top) have to be imported when in the `__init__.py` file.59 Not the object itself, but the module it is in. Do the importing at60 the *bottom* of the file.61 62-Here an example `__init__.py`::62+Here's an example `__init__.py`::63 64 from flask import Flask65 app = Flask(__name__)66 41 unmodified lines108 Working with Modules109 --------------------110 111 For larger applications with more than a dozen views it makes sense to112-split the views into modules. First let's look at the typical struture of112+split the views into modules. First let's look at the typical structure of113 such an application::114 115 /yourapplication116 /yourapplication15 unmodified lines132 `admin.py` file in the view package.133 134 First we have to create a :class:`~flask.Module` object with the name of135 the package. This works very similar to the :class:`~flask.Flask` object136-you have already worked with, it just does not support all of the method,136+you have already worked with, it just does not support all of the methods,137 but most of them are the same.138 139-Long story short, here a nice and concise example::139+Long story short, here's a nice and concise example::140 141 from flask import Module142 143 admin = Module(__name__)6 unmodified lines150 def login():151 pass152 153 @admin.route('/logout')154- def login():154+ def logout():155 pass156 157 Do the same with the `frontend.py` and then make sure to register the158 modules in the application (`__init__.py`) like this::41 unmodified linesmodified:docs/extensiondev.rst+1 added-1 removed
158 unmodified lines159 160 classes:161 Classes work mostly like initialization functions but can later be162 used to further change the behaviour. For an example look at how the163- `OAuth extension`_ works: ther is an `OAuth` object that provides163+ `OAuth extension`_ works: there is an `OAuth` object that provides164 some helper functions like `OAuth.remote_app` to create a reference to165 a remote application that uses OAuth.166 167 What to use depends on what you have in mind. For the SQLite 3 extension109 unmodified lines