From 0b7a74dda3284b03fac49851eaf130e876f183bd Mon Sep 17 00:00:00 2001 From: David Lord Date: Fri, 21 Sep 2018 06:05:52 -0700 Subject: [PATCH] split code and output --- docs/quickstart.rst | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 5a182f5d..a5fc3280 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -277,7 +277,9 @@ Why would you want to build URLs using the URL reversing function For example, here we use the :meth:`~flask.Flask.test_request_context` method to try out :func:`~flask.url_for`. :meth:`~flask.Flask.test_request_context` tells Flask to behave as though it's handling a request even while we use a -Python shell. See :ref:`context-locals`. :: +Python shell. See :ref:`context-locals`. + +.. code-block:: python from flask import Flask, url_for @@ -301,10 +303,13 @@ Python shell. See :ref:`context-locals`. :: print(url_for('login', next='/')) print(url_for('profile', username='John Doe')) - # / - # /login - # /login?next=/ - # /user/John%20Doe +.. code-block:: text + + / + /login + /login?next=/ + /user/John%20Doe + HTTP Methods ````````````