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)