Почему bottle не может найти шаблон(он лежит в папке views, она лежит рядом с server.py)?
from bottle import route,run, view
from datetime import datetime as dt
from random import random
@route("/")
@view("predictions")
def index():
pass
run(
host="localhost",
port=8080,
debug=True
)
# add your project directory to the sys.path
project_home = 'path_to_project_directory'
if project_home not in sys.path:
sys.path = [project_home] + sys.path
# make sure the default templates directory is known to Bottle
templates_dir = os.path.join(project_home, 'views/')
if templates_dir not in bottle.TEMPLATE_PATH:
bottle.TEMPLATE_PATH.insert(0, templates_dir)