from flask import Flask,render_template from DBConnection import DBConnection import logging import configparser logging.basicConfig( format='%(asctime)-15s [%(levelname)s] %(funcName)s: %(message)s', level=logging.DEBUG) config = configparser.ConfigParser() config.read('db.ini') db_connection = DBConnection() db_connection.connect(config['pidb']['host'],config['pidb']['user'],config['pidb']['password'],config['pidb']['database']) app = Flask(__name__) schueler = [ {'name':'Simpson','vorname': 'Bart'}, {'name':'Simpson','vorname':'Lisa'}, {'name':'van Houten','vorname':'Milhouse'}, {'name':'Wiggum','vorname':'Ralph'}, {'name':'Jones','vorname':'Jimbo'} ] @app.route('/') def index(): return render_template('students.html',schueler=schueler) if __name__ == '__main__': app.run(host='0.0.0.0',port=8085, debug=True)