getting some ui and index route going
This commit is contained in:
18
weather/weather.py
Normal file
18
weather/weather.py
Normal file
@@ -0,0 +1,18 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user