Skip to content

Instantly share code, notes, and snippets.

@vihar
Last active May 24, 2018 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vihar/370d1ebb10fc4c2999a7553164d669e4 to your computer and use it in GitHub Desktop.
Save vihar/370d1ebb10fc4c2999a7553164d669e4 to your computer and use it in GitHub Desktop.
from flask import Flask
app = Flask(__name__)
@app.route('/greet')
def greet():
user = {'username': 'John', 'age': "20"}
return '''
<html>
<head>
<title>Templating</title>
</head>
<body>
<h1>Hello, ''' + user['username'] + '''!, you’re ''' + user['age'] + ''' years old.</h1>
</body>
</html>'''
if __name__ == '__main__':
app.run(debug = True,port=8080)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment