From 15cd72414e39bd7350afc77d8db6864cf09f210e Mon Sep 17 00:00:00 2001 From: starnakin Date: Sat, 3 Jun 2023 22:51:12 +0200 Subject: [PATCH] add: add user method to database and init table --- Database.py | 1 + database.py | 1 + main.py | 1 + 3 files changed, 3 insertions(+) diff --git a/Database.py b/Database.py index 235b519..73e4e92 100644 --- a/Database.py +++ b/Database.py @@ -26,6 +26,7 @@ class Database: for key, value in content.keys(): command += f"{key} {value}, " command += ")" + self.cursor.execute(command) def create_user_table(self): self.cursor.execute("SHOW TABLES"); diff --git a/database.py b/database.py index d39d7f7..db8e5d9 100644 --- a/database.py +++ b/database.py @@ -7,3 +7,4 @@ user = config.database.get("user") password = config.database.get("password") database = Database.Database(host, port, user, password) +database.create_user_table() diff --git a/main.py b/main.py index 2bb8df2..b240766 100644 --- a/main.py +++ b/main.py @@ -1,4 +1,5 @@ import flask +import database app = flask.Flask(__name__)