Merge branch 'master' into json-sessions
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Armin Ronacher · committed by Armin Ronacher · parents 1740d7c, 43f4120 · Browse files · 8 files·+16 added−13 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
8 files+16 added−13 removed
- other:+16 added−13 removed
Provenance
- Commit
704d94d- Tree
6ed7e2c- Author
Armin Ronacher <armin.ronacher@active-4.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent 1
1740d7c- Parent 2
43f4120
8 files changed+16 added−13 removed
modified:docs/tutorial/dbinit.rst+4 added-2 removed
21 unmodified lines22 23 If you want to do that, you first have to import the24 :func:`contextlib.closing` function from the contextlib package. If you25 want to use Python 2.5 it's also necessary to enable the `with` statement26-first (`__future__` imports must be the very first import)::26+first (`__future__` imports must be the very first import). Accordingly,27+add the following lines to your existing imports in `flaskr.py`::28 29 from __future__ import with_statement30 from contextlib import closing31 32 Next we can create a function called `init_db` that initializes the33 database. For this we can use the `connect_db` function we defined33-earlier. Just add that function below the `connect_db` function::34+earlier. Just add that function below the `connect_db` function in35+`flask.py`::36 37 def init_db():38 with closing(connect_db()) as db:39 with app.open_resource('schema.sql') as f:30 unmodified linesmodified:docs/tutorial/introduction.rst+1 added-1 removed
1 unmodified line2 3 Introducing Flaskr4 ==================5 6-We will call our blogging application flaskr here, feel free to chose a6+We will call our blogging application flaskr here, feel free to choose a7 less web-2.0-ish name ;) Basically we want it to do the following things:8 9 1. let the user sign in and out with credentials specified in the10 configuration. Only one user is supported.23 unmodified linesmodified:docs/appcontext.rst+1 added-2 removed
42 unmodified lines43 you can have more than one application in the same Python process.44 45 So how does the code find the “right” application? In the past we46 recommended passing applications around explicitly, but that caused issues47-with libraries that were not designed with that in mind for libraries for48-which it was too inconvenient to make this work.47+with libraries that were not designed with that in mind.48 49 A common workaround for that problem was to use the50 :data:`~flask.current_app` proxy later on, which was bound to the current51 request's application reference. Since however creating such a request36 unmodified linesmodified:docs/design.rst+3 added-3 removed
88 unmodified lines89 since decorators could be fired in undefined order when the application is90 split into multiple modules.91 92 Another design decision with the Werkzeug routing system is that routes93-in Werkzeug try to ensure that there is that URLs are unique. Werkzeug94-will go quite far with that in that it will automatically redirect to a95-canonical URL if a route is ambiguous.93+in Werkzeug try to ensure that URLs are unique. Werkzeug will go quite far94+with that in that it will automatically redirect to a canonical URL if a route95+is ambiguous.96 97 98 One Template Engine99 -------------------92 unmodified linesmodified:docs/quickstart.rst+1 added-1 removed
375 unmodified lines376 /templates377 /hello.html378 379 For templates you can use the full power of Jinja2 templates. Head over380-to the the official `Jinja2 Template Documentation380+to the official `Jinja2 Template Documentation381 <http://jinja.pocoo.org/2/documentation/templates>`_ for more information.382 383 Here is an example template:384 469 unmodified linesmodified:flask/app.py+1 added-1 removed
1466 unmodified lines1467 .. versionadded:: 0.61468 1469 .. versionchanged:: 0.91470 This can now also be called without a request object when the1471- UR adapter is created for the application context.1471+ URL adapter is created for the application context.1472 """1473 if request is not None:1474 return self.url_map.bind_to_environ(request.environ,1475 server_name=self.config['SERVER_NAME'])226 unmodified linesmodified:flask/helpers.py+3 added-1 removed
303 unmodified lines304 :exc:`~werkzeug.routing.BuildError`.305 306 :param endpoint: the endpoint of the URL (name of the function)307 :param values: the variable arguments of the URL rule308- :param _external: if set to `True`, an absolute URL is generated.308+ :param _external: if set to `True`, an absolute URL is generated. Server309+ address can be changed via `SERVER_NAME` configuration variable which310+ defaults to `localhost`.311 :param _anchor: if provided this is added as anchor to the URL.312 :param _method: if provided this explicitly specifies an HTTP method.313 """314 appctx = _app_ctx_stack.top581 unmodified linesmodified:CHANGES+2 added-2 removed
13 unmodified lines14 15 Version 0.916 -----------17 18-Released on July 1st 2012, codename Camapri.18+Released on July 1st 2012, codename Campari.19 20 - The :func:`flask.Request.on_json_loading_failed` now returns a JSON formatted21 response by default.22 - The :func:`flask.url_for` function now can generate anchors to the62 unmodified lines85 86 Version 0.8.187 -------------88 89-Bugfix release, released on July 1th 201289+Bugfix release, released on July 1st 201290 91 - Fixed an issue with the undocumented `flask.session` module to not92 work properly on Python 2.5. It should not be used but did cause93 some problems for package managers.289 unmodified lines