BASE_DIR = Path(__file__).resolve().parent.parent db_path = BASE_DIR / 'db.sqlite3' # or db_path2 = os.path.join(str(BASE_DIR), 'db.sqlite3')