diff --git a/hello.py b/hello.py index 06f1145..e46999a 100644 --- a/hello.py +++ b/hello.py @@ -1,12 +1,13 @@ -from flask import Flask +from flask import Flask, render_template + app = Flask(__name__) @app.route('/') def index(): - return '

Hello World!

' + return render_template('index.html') @app.route('/user/') def user(name): - return '

Hello, {}!

'.format(name) + return render_template('user.html', name=name) diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..ba7c290 --- /dev/null +++ b/templates/index.html @@ -0,0 +1 @@ +

Hello World!

\ No newline at end of file diff --git a/templates/user.html b/templates/user.html new file mode 100644 index 0000000..5c637d1 --- /dev/null +++ b/templates/user.html @@ -0,0 +1 @@ +

Hello, {{ name }}!

\ No newline at end of file