From cf18cbdc4e0e3f162d5206f9981c9076e51a3d89 Mon Sep 17 00:00:00 2001 From: Firq Date: Mon, 2 Oct 2023 12:48:42 +0200 Subject: [PATCH] fixed directory issues --- backend/src/config/api_settings.py | 4 +++- backend/src/config/db_settings.py | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/src/config/api_settings.py b/backend/src/config/api_settings.py index 4109e29..5551acf 100644 --- a/backend/src/config/api_settings.py +++ b/backend/src/config/api_settings.py @@ -1,5 +1,7 @@ # pylint: disable=too-few-public-methods import os +import __main__ + class DefaultSettings: API_TITLE = "Support Organizer" API_VERSION = 0.1 @@ -25,4 +27,4 @@ class DefaultSettings: } } - FILE_SAVE_DIRECTORY = f"{os.getcwd()}/temp" + FILE_SAVE_DIRECTORY = f"{os.path.dirname(__main__.__file__)}/temp" diff --git a/backend/src/config/db_settings.py b/backend/src/config/db_settings.py index 3c85ce0..52a3a44 100644 --- a/backend/src/config/db_settings.py +++ b/backend/src/config/db_settings.py @@ -1,5 +1,6 @@ # pylint: disable=too-few-public-methods import os +import __main__ class DatabaseSettings: - DATABASE_DIRECTORY = f"{os.getcwd()}/database/storage" + DATABASE_DIRECTORY = f"{os.path.dirname(__main__.__file__)}/database/storage"