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.
31 lines
955 B
31 lines
955 B
1 year ago
|
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 = [
|
||
1 year ago
|
{'name':'Simpson','vorname': 'Bart','highlight': 'True'},
|
||
|
{'name':'Simpson','vorname':'Lisa',highlight': 'True'},
|
||
|
{'name':'van Houten','vorname':'Milhouse','highlight':'False'},
|
||
|
{'name':'Wiggum','vorname':'Ralph','highlight':'False'},
|
||
|
{'name':'Jones','vorname':'Jimbo','highlight':'False'}
|
||
1 year ago
|
]
|
||
|
|
||
|
@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)
|
||
|
|
||
|
|