dashboard
This commit is contained in:
@@ -23,15 +23,14 @@ def create_app(test_config=None):
|
|||||||
except OSError:
|
except OSError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# simple hello world page
|
|
||||||
@app.route('/hello')
|
|
||||||
def hello():
|
|
||||||
return 'Hello World!'
|
|
||||||
|
|
||||||
from . import db
|
from . import db
|
||||||
db.init_app(app)
|
db.init_app(app)
|
||||||
|
|
||||||
from . import auth
|
from . import auth
|
||||||
app.register_blueprint(auth.bp)
|
app.register_blueprint(auth.bp)
|
||||||
|
|
||||||
|
from . import dashboard
|
||||||
|
app.register_blueprint(dashboard.bp)
|
||||||
|
app.add_url_rule('/', endpoint='index')
|
||||||
|
|
||||||
return app
|
return app
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
import functools
|
||||||
|
|
||||||
|
from flask import(
|
||||||
|
Blueprint, flash, g, redirect, render_template, request, session, url_for
|
||||||
|
)
|
||||||
|
from werkzeug.exceptions import abort
|
||||||
|
|
||||||
|
from flaskfdx.auth import login_required
|
||||||
|
from flaskfdx.db import get_db
|
||||||
|
|
||||||
|
bp = Blueprint('dashboard', __name__)
|
||||||
|
|
||||||
|
bp.route('/')
|
||||||
|
def index():
|
||||||
|
db = get_db()
|
||||||
|
lastseven = db.execute(
|
||||||
|
'SELECT * FROM total WHERE datetime(date) > datetime("now", "-8 days")'
|
||||||
|
).fetchall()
|
||||||
|
return render_template('dashboard/index.html', lastseven=lastseven)
|
||||||
Reference in New Issue
Block a user