You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
856 B
30 lines
856 B
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)
|
|
|
|
|
|
|