@app.route('/')
def index():
try:
products = Product.query.all()
return render_template('index.html', products=products)
except Exception as e:
error_text = "<p>The error:<br>" + str(e) + "</p>"
hed = '<h1>Something is broken.</h1>'
return hed + error_text