feat: Attachment 모델 추가 및 관련 기능 구현
All checks were successful
Build And Test / build-and-push (push) Successful in 2m5s

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-20 23:39:05 +09:00
parent 362412f0c9
commit dfecaa7654
9 changed files with 447 additions and 7 deletions

View File

@ -111,6 +111,7 @@ INSTALLED_APPS = [
'rest_framework_simplejwt',
'drf_yasg',
'corsheaders',
'storages', # MinIO/S3 스토리지
# create by.sdjo 2025-04-22
'blog', # 2025-04-22 custom app create
]
@ -253,3 +254,29 @@ STATIC_URL = 'static/'
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
# MinIO (S3 호환) 스토리지 설정
MINIO_ENDPOINT = os.environ.get('MINIO_ENDPOINT', 'minio.icurfer.com:9000')
MINIO_ACCESS_KEY = os.environ.get('MINIO_ACCESS_KEY', '')
MINIO_SECRET_KEY = os.environ.get('MINIO_SECRET_KEY', '')
MINIO_BUCKET = os.environ.get('MINIO_BUCKET', 'icurfer.com-posts')
MINIO_USE_SSL = os.environ.get('MINIO_USE_SSL', '1') == '1'
# django-storages S3 설정 (MinIO 호환)
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
AWS_ACCESS_KEY_ID = MINIO_ACCESS_KEY
AWS_SECRET_ACCESS_KEY = MINIO_SECRET_KEY
AWS_STORAGE_BUCKET_NAME = MINIO_BUCKET
AWS_S3_ENDPOINT_URL = f"{'https' if MINIO_USE_SSL else 'http'}://{MINIO_ENDPOINT}"
AWS_S3_USE_SSL = MINIO_USE_SSL
AWS_S3_VERIFY = MINIO_USE_SSL
AWS_DEFAULT_ACL = None
AWS_S3_FILE_OVERWRITE = False
AWS_QUERYSTRING_AUTH = True
AWS_S3_SIGNATURE_VERSION = 's3v4'
AWS_S3_REGION_NAME = os.environ.get('MINIO_REGION_NAME', 'ap-northeast-2')
# 최대 업로드 파일 크기 (10MB)
DATA_UPLOAD_MAX_MEMORY_SIZE = 10 * 1024 * 1024
FILE_UPLOAD_MAX_MEMORY_SIZE = 10 * 1024 * 1024