-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
34 lines (28 loc) · 781 Bytes
/
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
from flask import Flask, render_template, url_for
app = Flask(__name__)
posts = [
{
'author': 'Phil Wamba',
'title': 'First Blog Posts',
'content': 'My first blog posts content',
'date_posted': 'March, 20, 2019'
},
{
'author': 'Jane Doe',
'title': 'Second Blog Posts',
'content': 'My first blog posts content',
'date_posted': 'March, 21, 2019'
}
]
@app.route("/")
@app.route("/home")
def hello():
return render_template('home.html', posts=posts, title='Home')
@app.route("/post/")
def hello():
return render_template('home.html', posts=posts, title='Home')
@app.route("/about")
def about():
return render_template('about.html', title='About')
if __name__ == "__main__":
app.run()