Skip to content

Commit

Permalink
fix: 개발서버 파일 업로드 경로 업데이트
Browse files Browse the repository at this point in the history
  • Loading branch information
korjsh committed Dec 11, 2024
1 parent ec4dd2d commit aefe069
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 4 additions & 1 deletion app/database.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from pathlib import Path

import os
import sys
import logging
Expand All @@ -11,7 +13,8 @@
BASE_DIR = os.path.dirname(sys.executable) # 실행 파일의 디렉토리
else:
print("dev server")
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
BASE_DIR = Path(__file__).resolve().parents[1] # 상위 두 단계로 이동하여 최상위 디렉토리 참조

SQLALCHEMY_DATABASE_URL = f"sqlite:///{os.path.join(BASE_DIR, 'test.db')}"
print(f"Base Directory:{BASE_DIR}")
print(f"Database Path:{SQLALCHEMY_DATABASE_URL}")
Expand Down
3 changes: 0 additions & 3 deletions app/routers/db_manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
BASE_DIR = Path(__file__).resolve().parents[2] # 상위 두 단계로 이동하여 최상위 디렉토리 참조
UPLOAD_DIR = BASE_DIR # 업로드된 파일을 저장할 폴더 지정

# 업로드 폴더가 없으면 생성
UPLOAD_DIR.mkdir(parents=True, exist_ok=True)

# 허용된 파일 확장자
ALLOWED_EXTENSIONS = {".sqlite", ".db"}

Expand Down

0 comments on commit aefe069

Please sign in to comment.