Skip to content
Myr

Merge pull request #276 from consigliere/patch-1

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Corrected decorators to remove duplicate teardown_request() and add after

authored by Armin Ronacher · committed by Armin Ronacher · parents 76c8bb5, 1a249e3 · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:docs/tutorial/dbcon.rst+1 added-1 removed
7 unmodified lines
8connection in all our functions so it makes sense to initialize them9before each request and shut them down afterwards.1011Flask allows us to do that with the :meth:`~flask.Flask.before_request`,12:meth:`~flask.Flask.teardown_request` and :meth:`~flask.Flask.teardown_request`12:meth:`~flask.Flask.after_request` and :meth:`~flask.Flask.teardown_request`13decorators::1415 @app.before_request16 def before_request():
25 unmodified lines