now rooms, recorders and recorder models get initialized in DB

This commit is contained in:
Tobias Kurze
2019-11-20 16:19:59 +01:00
parent 60ff5bdeaf
commit 7700b4381f
6 changed files with 191 additions and 70 deletions

View File

@@ -16,6 +16,9 @@ from backend.tools.model_updater import update_recorder_models_database
def main():
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
db.drop_all()
db.create_all()
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:
@@ -31,8 +34,8 @@ def main():
except Exception as e:
logging.critical(e)
room_model.pre_fill_table()
recorder_model.pre_fill_table()
update_recorder_models_database()
app.run(debug=True, host="0.0.0.0")