From a8b42f0c90dd2702fd1acbacd97c2f8950ee8401 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurij=20Podgor=C5=A1ek?= Date: Wed, 7 Sep 2022 23:22:11 +0200 Subject: [PATCH] Ustvari engine samo 1x --- create_db.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/create_db.py b/create_db.py index e56028a..ce1838f 100644 --- a/create_db.py +++ b/create_db.py @@ -49,6 +49,7 @@ engine = create_engine(CONFIG['DB_CONNECTION']) Base.metadata.create_all(engine) def get_session(): - engine = create_engine(CONFIG['DB_CONNECTION']) + # Engine je samo enkrat treba inicializirat, se mi zdi. + # engine = create_engine(CONFIG['DB_CONNECTION']) dbsessionmaker = sessionmaker(bind=engine) return dbsessionmaker()