I have the following app:
#!/usr/bin/python3
from bottle import template, route, run
import html
cabeca = ('''
<html lang="pt-br">
<head>
</head>
<body>
<nav id="menu">
{{menu}}
</nav>
<main id="conteudo">
{{conteudo}}
</main>
</body>
</html>
''')
menu = (('add', 'flaticon-add', 'Adicionar'),
('busca', 'flaticon-target', 'Buscar'),
('balanco', 'flaticon-coin', 'Balanço'),
('conf', 'flaticon-settings', 'Configurações'))
def cria_menu():
bloco = ('<nav id="menu">')
for item in menu:
bloco += ('<div class="menu-item">\
<a class="menu-link" href="{}">\
<img class="{} menu-icon" alt="{}"/>\
</a>\
</div>\
'.format(item[0], item[1], item[2]))
bloco += ('</nav>')
return(bloco)
@route('/')
def index():
return(template(cabeca, menu = html.unescape(cria_menu())\
.replace('<', '<')\
.replace('>', '>')\
.replace('"', '"'), conteudo = 'Alguma coisa'))
run(port = 8000, debug = True, reloader = True)
No matter what I do, I can not render the page.