Skip to content
Myr

Add clarification for login_required decorator ref #313

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

authored by Ping Hu · committed by David Lord · parent aa9a994 · Browse files · 1 file+6 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+6 added−1 removed

  • other:+6 added−1 removed

1 file+6 added−1 removed

modified:docs/patterns/viewdecorators.rst+6 added-1 removed
37 unmodified lines
38 return decorated_function3940So how would you use that decorator now? Apply it as innermost decorator41to a view function. When applying further decorators, always remember42that the :meth:`~flask.Flask.route` decorator is the outermost::42that the :meth:`~flask.Flask.route` decorator is the outermost.4344While the ``next`` value may exist in ``request.args`` after a ``GET`` request for45the login form, you'll have to pass it along when sending the ``POST`` request46from the login form. You can do this with a hidden input tag and ``requests.values``47or ``requests.form``.::4849 @app.route('/secret_page')50 @login_required51 def secret_page():52 pass
118 unmodified lines