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

11 lines
254 B
Python

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()