Created
March 13, 2017 10:26
-
-
Save raj454raj/236adc972da89bcff961e9b6de0bd52e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- File: layout.html --> | |
<!DOCTYPE html> | |
<html> | |
<body> | |
<h1>Hello {{ name }}!</h1> | |
<h1>Age {{ age }}!</h1> | |
{% for i in range(5) %} | |
<h2> {{ i }} </h2> | |
{% endfor %} | |
</body> | |
</html> |
server.py
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/hello/<user>')
def hello_name(user):
l = [("Raj", 21), ("harshit", "20"), ("Hitesh", 25)]
return render_template('layout.html', name=user, age=21, user_list=l)
if __name__ == '__main__':
app.run(debug = True)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated layout.html