Skip to content

Commit 6523a39

Browse files
Add basic templates to remove HTML from view
1 parent c4e5cec commit 6523a39

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

tvseries/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
from flask import Flask
1+
from flask import Flask, render_template
22

33
app = Flask(__name__)
44

55

66
@app.route('/')
77
def home():
8-
return "<h1>Hello world!</h1>"
8+
return render_template('home.html')
99

1010

1111
@app.route('/<name>')
1212
def name(name):
13-
return "<h1>Hello {}!</h1>".format(name)
13+
return render_template('home2.html', name=name)

tvseries/templates/home.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<h1>Hello world!</h1>

tvseries/templates/home2.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<h1>Hello {{ name }}!</h1>

0 commit comments

Comments
 (0)