diff --git a/app.py b/app.py index 353ec2f..f7ee772 100644 --- a/app.py +++ b/app.py @@ -5,6 +5,8 @@ from flask import render_template import qrcode +from gsheet_utils import GSheet + from io import BytesIO import base64 @@ -16,10 +18,12 @@ app = Flask(__name__) donations = db_connect_to_collection(MONGO_URI, 'viveros', 'donaciones') +gsheet = GSheet() @app.route('/') def index(): - return render_template('index.html') + total_donations = gsheet.get_data("'donaciones 2020'!I1")[0][0] + return render_template('index.html', total_donations=f"{int(total_donations):,}") @app.route('/dashboard') diff --git a/templates/index.html b/templates/index.html index 076f5e8..8edf8fd 100644 --- a/templates/index.html +++ b/templates/index.html @@ -74,7 +74,7 @@