using reflection to get models

This commit is contained in:
Tobias Kurze
2019-08-02 16:09:39 +02:00
parent 3c6b6ba099
commit 51536766bf
7 changed files with 200 additions and 36 deletions

View File

@@ -2,10 +2,27 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2019. Tobias Kurze
import logging
import ssl
from jinja2.exceptions import TemplateNotFound
from backend import app
def main():
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
print(app.config.get("SERVER_NAME", None))
server_name = app.config.get("SERVER_NAME", None)
if server_name is not None and "ubkaps154.ubka.uni-karlsruhe.de" in server_name:
try:
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
context.load_cert_chain('cert.pem', 'key.pem')
app.run(debug=True, ssl_context=context, threaded=True)
except FileNotFoundError:
app.run(debug=True, threaded=True)
app.run(debug=True)