-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
43 lines (34 loc) · 1.01 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def index():
title = 'Saluton, mondo!'
return render_template('index.html', title=title)
@app.route('/about')
def about():
title = 'About Me'
return render_template('about.html', title=title)
@app.route('/my-table')
def my_table():
title = 'My Table'
table_rows = [
{
'pic': 'http://placehold.it/100x100?text=A',
'name': 'A',
'notes': 'Lorem ipsum...'
},
{
'pic': 'http://placehold.it/100x100?text=B',
'name': 'B',
'notes': 'Ipsum lorem...'
},
{
'pic': 'http://placehold.it/100x100?text=C',
'name': 'C',
'notes': 'Ipsum lorem ipsum...'
},
]
return render_template('my_table.html', title=title, table_rows=table_rows)
if __name__ == '__main__':
# This only runs if you run the script from the command line, not in the REPL
app.run(debug=True, port=5001)