Merge branch 'master' into json-sessions

This commit is contained in:
Armin Ronacher 2012-08-11 02:37:52 +01:00
commit 704d94d7b9
8 changed files with 16 additions and 13 deletions

View file

@ -44,8 +44,7 @@ you can have more than one application in the same Python process.
So how does the code find the “right” application? In the past we
recommended passing applications around explicitly, but that caused issues
with libraries that were not designed with that in mind for libraries for
which it was too inconvenient to make this work.
with libraries that were not designed with that in mind.
A common workaround for that problem was to use the
:data:`~flask.current_app` proxy later on, which was bound to the current

View file

@ -90,9 +90,9 @@ since decorators could be fired in undefined order when the application is
split into multiple modules.
Another design decision with the Werkzeug routing system is that routes
in Werkzeug try to ensure that there is that URLs are unique. Werkzeug
will go quite far with that in that it will automatically redirect to a
canonical URL if a route is ambiguous.
in Werkzeug try to ensure that URLs are unique. Werkzeug will go quite far
with that in that it will automatically redirect to a canonical URL if a route
is ambiguous.
One Template Engine

View file

@ -377,7 +377,7 @@ package it's actually inside your package:
/hello.html
For templates you can use the full power of Jinja2 templates. Head over
to the the official `Jinja2 Template Documentation
to the official `Jinja2 Template Documentation
<http://jinja.pocoo.org/2/documentation/templates>`_ for more information.
Here is an example template:

View file

@ -23,14 +23,16 @@ for you to the application.
If you want to do that, you first have to import the
:func:`contextlib.closing` function from the contextlib package. If you
want to use Python 2.5 it's also necessary to enable the `with` statement
first (`__future__` imports must be the very first import)::
first (`__future__` imports must be the very first import). Accordingly,
add the following lines to your existing imports in `flaskr.py`::
from __future__ import with_statement
from contextlib import closing
Next we can create a function called `init_db` that initializes the
database. For this we can use the `connect_db` function we defined
earlier. Just add that function below the `connect_db` function::
earlier. Just add that function below the `connect_db` function in
`flask.py`::
def init_db():
with closing(connect_db()) as db:

View file

@ -3,7 +3,7 @@
Introducing Flaskr
==================
We will call our blogging application flaskr here, feel free to chose a
We will call our blogging application flaskr here, feel free to choose a
less web-2.0-ish name ;) Basically we want it to do the following things:
1. let the user sign in and out with credentials specified in the