nglk
4 years ago
4 changed files with 21 additions and 0 deletions
Binary file not shown.
@ -0,0 +1,14 @@ |
|||||
|
from flask import Flask |
||||
|
from flask import render_template |
||||
|
|
||||
|
app = Flask(__name__) |
||||
|
|
||||
|
@app.route('/') |
||||
|
def hello_world(): |
||||
|
return 'Hello, World!' |
||||
|
|
||||
|
|
||||
|
@app.route('/hello/') |
||||
|
@app.route('/hello/<name>') |
||||
|
def hello(name=None): |
||||
|
return render_template('hello.html', name=name) |
@ -0,0 +1,7 @@ |
|||||
|
<!doctype html> |
||||
|
<title>Hello from Flask</title> |
||||
|
{% if name %} |
||||
|
<h1>Hello {{ name }}!</h1> |
||||
|
{% else %} |
||||
|
<h1>VVVW</h1> |
||||
|
{% endif %} |
Loading…
Reference in new issue