fixed database connection

master
Marek Baczynski 6 years ago
parent 056de43a91
commit 0cd0265599

@ -4,6 +4,7 @@ import json
import datetime
from flask import Flask, Response, redirect, url_for, request, session, abort, render_template
from flask_login import LoginManager, UserMixin, login_required, login_user, logout_user, current_user
import sqlalchemy
from sqlalchemy.sql import select, text
from dateutil.parser import parse
app = Flask(__name__)
@ -45,9 +46,10 @@ def getUpcomingMeals():
def index():
return render_template('meal_list.html', leaderboard=getLeaderboard(), meals=getUpcomingMeals(), current_user_name='Wille')
if __name__ == '__main__':
with open('admin.json') as f:
postgres_credentials = json.load(f)
db_engine, db_metadata = connect(postgres_credentials['username'], postgres_credentials['password'], 'kuk_app')
meals = sqlalchemy.Table('meals', db_metadata)
if __name__ == '__main__':
app.run('0.0.0.0')
Loading…
Cancel
Save