return render_template('ana.html', **context)


@app.route('/guilherme')
def ana():

    menu = []

    menu.append({
        'active': False,
        'href': '/',
        'texto': 'Presenças Registradas'
    })
    menu.append({
        'active': False,
        'href': '/presenca',
        'texto': 'Registrar Presenças'
    })
    menu.append({'active': False, 'href': '/pedro', 'texto': 'Pedro'})
    menu.append({'active': False, 'href': '/andre', 'texto': 'Andre'})
    menu.append({'active': False, 'href': '/ana', 'texto': 'Ana'})
    menu.append({'active': True, 'href': '/guilherme', 'texto': 'Guilherme'})

    context = {'presenca': 'Sobre - Guilherme', 'menu': menu}

    return render_template('guilherme.html', **context)


app.run()
示例#2
0
from aplicacao import app
from flask import render_template


@app.route('/')
def index():
    context = {
        'titulo': 'Página Flask',
        'outro': 'Novo Texto',
        'lista': ['a', 'b', 'c']
    }
    retorno = render_template('index.html', **context)
    print(retorno)
    return retorno


app.run(debug=True)