use brightdata proxy
This commit is contained in:
@@ -3,6 +3,21 @@ import os
|
||||
import getpass
|
||||
from pathlib import Path
|
||||
|
||||
import sqlalchemy as sqlalchemy
|
||||
from sqlalchemy_utils import create_database
|
||||
from sqlalchemy_utils.functions import database_exists
|
||||
|
||||
|
||||
def init_db(path: str):
|
||||
uri_for_db = "sqlite:///{}/{}.db".format(path, "appointment")
|
||||
print(uri_for_db)
|
||||
# 2.-Turn on database engine
|
||||
dbEngine = sqlalchemy.create_engine(uri_for_db) # ensure this is the correct path for the sqlite file.
|
||||
if not database_exists(uri_for_db):
|
||||
create_database(uri_for_db)
|
||||
dbEngine.connect()
|
||||
|
||||
|
||||
home = str(Path.home())
|
||||
config = configparser.ConfigParser()
|
||||
print("home path: " + home)
|
||||
@@ -15,4 +30,5 @@ LOGS_DIR = config['DEFAULT']['LOGS_DIR']
|
||||
username = getpass.getuser()
|
||||
LOG_SOURCE = username
|
||||
|
||||
init_db(home)
|
||||
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
Reference in New Issue
Block a user