Files
flask-weather/weather/weather.py

18 lines
419 B
Python

from flask import (
Blueprint, flash, g, render_template, request, url_for
)
from werkzeug.exceptions import abort
from weather.db import get_db
bp = Blueprint('weather', __name__)
@bp.route('/')
def index():
db = get_db()
periods = db.execute(
'SELECT *'
' FROM `periods`'
' ORDER BY `id` DESC'
).fetchall()
return render_template('weather/index.html', periods=periods)