From 46a0eae7d17cd6b6e125cff85385ecfcc4ec966f Mon Sep 17 00:00:00 2001 From: Mikan <72257910+Mikan-DS@users.noreply.github.com> Date: Mon, 16 Sep 2024 17:36:22 +0300 Subject: [PATCH] fix --- bd_config.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bd_config.py b/bd_config.py index f6ffeaa..dd0eccf 100644 --- a/bd_config.py +++ b/bd_config.py @@ -6,14 +6,14 @@ __all__ = ["default_database"] BASE_DIR = Path(__file__).resolve().parent -if not os.path.exists('config.json'): - with open('config.json', 'w', encoding='utf-8') as config_file: +if not os.path.exists(os.path.join(BASE_DIR, 'config.json')): + with open(os.path.join(BASE_DIR, 'config.json'), 'w', encoding='utf-8') as config_file: json.dump({ 'ENGINE': 'django.db.backends.sqlite3', 'NAME': str(BASE_DIR / 'db.sqlite3'), }, config_file, ensure_ascii=False, indent=4) -with open('config.json', 'r', encoding='utf-8') as config_file: +with open(os.path.join(BASE_DIR, 'config.json'), 'r', encoding='utf-8') as config_file: default_database = json.load(config_file)