diff options
author | Marcel Hellkamp <marc@gsites.de> | 2012-09-16 16:08:11 -0700 |
---|---|---|
committer | Marcel Hellkamp <marc@gsites.de> | 2012-09-16 16:08:11 -0700 |
commit | d3a6e1b9758bf93b91db16d99e39edcd2ec50711 (patch) | |
tree | 526e54355244847e3a358e82158ce394a60c3cc1 | |
parent | d729bcb2d6eecac8b92d60dd547779f5961d49a1 (diff) | |
parent | 47784117e07a5a60af3d1500070358ee28e6d20d (diff) | |
download | bottle-d3a6e1b9758bf93b91db16d99e39edcd2ec50711.tar.gz |
Merge pull request #376 from graingert/patch-2
use template in tutorial to match index
-rwxr-xr-x | docs/tutorial.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/tutorial.rst b/docs/tutorial.rst index 6b49fa9..9ef531d 100755 --- a/docs/tutorial.rst +++ b/docs/tutorial.rst @@ -93,7 +93,7 @@ The `Default Application` For the sake of simplicity, most examples in this tutorial use a module-level :func:`route` decorator to define routes. This adds routes to a global "default application", an instance of :class:`Bottle` that is automatically created the first time you call :func:`route`. Several other module-level decorators and functions relate to this default application, but if you prefer a more object oriented approach and don't mind the extra typing, you can create a separate application object and use that instead of the global one:: - from bottle import Bottle, run + from bottle import Bottle, run, template app = Bottle() @@ -124,7 +124,7 @@ The :func:`route` decorator links an URL path to a callback function, and adds a @route('/') @route('/hello/<name>') def greet(name='Stranger'): - return 'Hello %s, how are you?' % name + return template('Hello {{name}}, how are you?', name=name) This example demonstrates two things: You can bind more than one route to a single callback, and you can add wildcards to URLs and access them via keyword arguments. |