Refactor import paths and enhance logging in various modules; add user table creation in start.py
This commit is contained in:
@@ -2,7 +2,7 @@ from dotenv import load_dotenv
|
||||
import db
|
||||
import os
|
||||
import logging
|
||||
import api_security as auth
|
||||
import auth.api_security as auth
|
||||
|
||||
#Logging
|
||||
|
||||
@@ -44,8 +44,15 @@ def new_table(name):
|
||||
db.connection.commit()
|
||||
logging.info("Table 'luggage' created")
|
||||
|
||||
if name == "user":
|
||||
executed = "CREATE TABLE user (username VARCHAR(50) PRIMARY KEY, password VARCHAR(255))"
|
||||
cursor.execute(executed)
|
||||
db.connection.commit()
|
||||
logging.info("Table 'user' created")
|
||||
|
||||
|
||||
new_table("tokens")
|
||||
new_table("luggage")
|
||||
new_table("user")
|
||||
print(auth.admin_token())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user