Commit 6e3b40f8 authored by harshavardhan.c's avatar harshavardhan.c

Project structure for new maintenance logbook

parent d345e786
......@@ -15,9 +15,9 @@ authMechanism=
mongo_constants_file_path= conf/mongo_encryption_constants.json
[DB]
type = postgres
type = postgresql
host = localhost
port = 2717
port = 5432
username =
password =
name = ilens_logbook
\ No newline at end of file
name = postgres
\ No newline at end of file
......@@ -6,7 +6,7 @@ from pydantic import BaseSettings
from __root__ import path
config = ConfigParser()
db_folder_path = os.path.join(path(), 'db')
try:
_config = SafeConfigParser()
......@@ -37,6 +37,8 @@ class _Configuration(BaseSettings):
MONGO_ENCRYPTION_FILE_PATH: str = _config.get("MONGO_DB", "mongo_constants_file_path",
fallback="conf/mongo_encryption_constants.json")
LOG_LEVEL: str = _config.get("LOG", "level", fallback="trace")
DB_TYPE: str = _config.get('DB', 'type', fallback='postgres')
DB_HOST: str = _config.get('DB', 'host', fallback='localhost')
DB_PORT: int = _config.get('DB', 'port', fallback=2717)
......@@ -83,3 +85,7 @@ class SqlDB(object):
DB_PASSWORD = _conf.DB_PASSWORD
DB_NAME = _conf.DB_NAME
SQLITE_DEFAULT_DB_PATH = _conf.SQLITE_DEFAULT_DB_PATH
class Log(object):
LOG_LEVEL = _conf.LOG_LEVEL
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment