Skip to content
Myr

fix syntax error and typo in quickstart.rst

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

authored by Daiana Marasquin · committed by David Lord · parent 4c8ec8f · Browse files · 1 file+4 added−2 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+4 added−2 removed

  • other:+4 added−2 removed

1 file+4 added−2 removed

modified:docs/quickstart.rst+4 added-2 removed
291 unmodified lines
292 return 'login'293294 @app.route('/user/<username>')295 def profile(username):296 return '{}'s profile'.format(username)296 return '{}\'s profile'.format(username)297298 with app.test_request_context():299 print(url_for('index'))300 print(url_for('login'))
13 unmodified lines
314a route only answers to ``GET`` requests. You can use the ``methods`` argument315of the :meth:`~flask.Flask.route` decorator to handle different HTTP methods.316::317318 from flask import request319320 @app.route('/login', methods=['GET', 'POST'])321 def login():322 if request.method == 'POST':323 return do_the_login()324 else:325 return show_the_login_form()326327If ``GET`` is present, Flask automatically adds support for the ``HEAD`` method326and handles ``HEAD`` requests according to the the `HTTP RFC`_. Likewise,328and handles ``HEAD`` requests according to the `HTTP RFC`_. Likewise,329``OPTIONS`` is automatically implemented for you.330331.. _HTTP RFC: https://www.ietf.org/rfc/rfc2068.txt332
519 unmodified lines