From 2041672b2247ee9a5acb502787f5458939b3387b Mon Sep 17 00:00:00 2001 From: Jannick Date: Tue, 30 Apr 2024 14:56:07 +0200 Subject: Update database added another table to the database also changed some minor stuff with the running and shit dw about it :) --- app.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'app.py') diff --git a/app.py b/app.py index d69e8e1..36d2c86 100644 --- a/app.py +++ b/app.py @@ -21,6 +21,7 @@ AUTH_BASE_URL = 'https://oauth.battle.net/authorize' TOKEN_URL = "https://oauth.battle.net/token" client = WebApplicationClient(CLIENT_ID) +# Database initialization DB_PATH = "thisisadatabasethatcontainsdata.db" connection = sqlite3.connect(DB_PATH) @@ -30,12 +31,15 @@ cursor.executescript(""" username VARCHAR(12) NOT NULL, preferredRole VARCHAR(6) NOT NULL, motivation TEXT NOT NULL, + + CREATE TABLE IF NOT EXISTS users ( userId INTEGER UNIQUE NOT NULL ); """) cursor.close() connection.close() + app = Bottle() plugin = sqlite.Plugin(dbfile=DB_PATH) app.install(plugin) @@ -128,5 +132,4 @@ def server_static(type, filename): return static_file(filename, root=f"./static/{type}/") debug(True) -run(app, host='localhost', port=8080, reloader=True, - server="gevent", keyfile="./pki/server.key", certfile="./pki/server.crt") +run(app, host='localhost', port=8080, server="gevent", keyfile="./pki/server.key", certfile="./pki/server.crt", reloader=True) -- cgit v1.2.3