diff options
author | Jannick <[email protected]> | 2024-04-30 14:56:07 +0200 |
---|---|---|
committer | Jannick <[email protected]> | 2024-04-30 14:56:07 +0200 |
commit | 2041672b2247ee9a5acb502787f5458939b3387b (patch) | |
tree | 26e38bbcd47f8d02d6185aa856db67d5442adc85 /app.py | |
parent | 46ed2f9e09d0425a6cb0cb29fd300006fd96adc3 (diff) |
Update database
added another table to the database
also changed some minor stuff with the running and shit dw about it :)
Diffstat (limited to 'app.py')
-rw-r--r-- | app.py | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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) |