summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Grainger <tagrain@gmail.com>2012-09-17 00:36:09 +0200
committerThomas Grainger <tagrain@gmail.com>2012-09-17 00:36:09 +0200
commit47784117e07a5a60af3d1500070358ee28e6d20d (patch)
tree526e54355244847e3a358e82158ce394a60c3cc1
parentd729bcb2d6eecac8b92d60dd547779f5961d49a1 (diff)
downloadbottle-47784117e07a5a60af3d1500070358ee28e6d20d.tar.gz
use template in tutorial to match index
-rwxr-xr-xdocs/tutorial.rst4
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.