Flask-Workshop/01-hello-world-templates.py

11 lines
254 B
Python
Raw Normal View History

2020-11-22 13:41:09 +00:00
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
@app.route('/index')
def index():
user = {'username': 'Simon'}
return render_template('index.html', title='Home', user=user)
if __name__ == '__main__':
app.run()