** Я написал этот код, но у меня ошибка с chart2.Any кто-то может помочь?**
from bottle import get, post, route, run, template, static_file, request, response, error, redirect, debug, error
from bottle import Bottle
from flask import Flask
from flask import Markup
from flask import Flask
from flask import render_template
app = Flask(__name__)
@route('/static/<filename:path>')
def send_static(filename):
return static_file(filename, root='./static/')
@app.route('/')
def chart():
labels = ["2009-Q1","2009-Q2","2009-Q3","2009-Q4","2009-Q1","2009-Q2","2009-Q3","2009-Q4","2009-Q1","2009-Q2","2009-Q3","2009-Q4"]
values = [9,6,6,10,9,7,5,4,10,6,10,8]
return render_template('chart.html', values=values, labels=labels)
@app.route('/chart2/')
def chart2():
labels = ["2009-Q1","2009-Q2","2009-Q3","2009-Q4","2009-Q1","2009-Q2","2009-Q3","2009-Q4","2009-Q1","2009-Q2","2009-Q3","2009-Q4"]
values = [9,6,6,10,9,7,5,4,10,6,10,8]
return template('ch.tpl', root='/path/to/file')
if __name__ == "__main__":
app.run(host='0.0.0.0', port=5001, debug=True)
Я получаю ошибку: "raise TemplateError('Template %s not found.' % repr(name))"
Я получаю это, когда пытаюсь вызвать /chart2/
представление