forked from orbit-oss/flask
commit
e3ba459abb
1 changed files with 3 additions and 3 deletions
|
|
@ -18,7 +18,7 @@ A minimal Flask application looks something like this::
|
||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
def hello_world():
|
def hello_world():
|
||||||
return 'Hello World!'
|
return 'Hello, World!'
|
||||||
|
|
||||||
So what did that code do?
|
So what did that code do?
|
||||||
|
|
||||||
|
|
@ -172,7 +172,7 @@ bind a function to a URL. Here are some basic examples::
|
||||||
|
|
||||||
@app.route('/hello')
|
@app.route('/hello')
|
||||||
def hello():
|
def hello():
|
||||||
return 'Hello World'
|
return 'Hello, World'
|
||||||
|
|
||||||
But there is more to it! You can make certain parts of the URL dynamic and
|
But there is more to it! You can make certain parts of the URL dynamic and
|
||||||
attach multiple rules to a function.
|
attach multiple rules to a function.
|
||||||
|
|
@ -430,7 +430,7 @@ Here is an example template:
|
||||||
{% if name %}
|
{% if name %}
|
||||||
<h1>Hello {{ name }}!</h1>
|
<h1>Hello {{ name }}!</h1>
|
||||||
{% else %}
|
{% else %}
|
||||||
<h1>Hello World!</h1>
|
<h1>Hello, World!</h1>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
Inside templates you also have access to the :class:`~flask.request`,
|
Inside templates you also have access to the :class:`~flask.request`,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue