Skip to content

Commit 9b94d58

Browse files
committed
섬네일 이미지 링크 완료
1 parent 21fe451 commit 9b94d58

File tree

4 files changed

+117
-2
lines changed

4 files changed

+117
-2
lines changed

backend/.env

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
POSTGRES_DB=oz06project
22
POSTGRES_USER=oz06
33
POSTGRES_PASSWORD=oz06pw123ㄴ
4+
5+
6+
7+
# 네이버 클라우드 객체 스토리지 버킷 정보
8+
NCP_BUCKET_NAME=240429-bucket2
9+
NCP_ACCESS_KEY=YHoRoOdaeXpdpiALGJzE
10+
NCP_SECRET_KEY=zTMivNsQyIDQgdhRmIqdMZmCzGLocvBK0kkgKObI
11+
NCP_REGION_NAME=kr-standard

backend/config/settings.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,20 @@
175175
}
176176
}
177177

178+
# 네이버 클라우드 객체 스토리지 버킷 정보
179+
NCP_BUCKET_NAME = env('NCP_BUCKET_NAME')
180+
NCP_ACCESS_KEY = env('NCP_ACCESS_KEY')
181+
NCP_SECRET_KEY = env('NCP_SECRET_KEY')
182+
NCP_REGION_NAME = env('NCP_REGION_NAME')
183+
184+
# DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
185+
AWS_STORAGE_BUCKET_NAME = NCP_BUCKET_NAME
186+
AWS_ACCESS_KEY_ID = NCP_ACCESS_KEY
187+
AWS_SECRET_ACCESS_KEY = NCP_SECRET_KEY
188+
AWS_S3_REGION_NAME = NCP_REGION_NAME
189+
AWS_S3_CUSTOM_DOMAIN = f'https://kr.object.ncloudstorage.com/{NCP_BUCKET_NAME}'
190+
191+
178192

179193
# Password validation
180194
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators
@@ -218,7 +232,9 @@
218232
# BASE_DIR / 'static'
219233
]
220234

221-
MEDIA_URL = 'http://www.pette.me/media/'
235+
MEDIA_URL = 'https://kr.object.ncloudstorage.com/240429-bucket2/'
236+
# MEDIA_URL = 'https://kr.object.ncloudstorage.com/pette/'
237+
# MEDIA_URL = 'http://www.pette.me/media/'
222238
# MEDIA_URL = 'media/'
223239
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
224240
# Default primary key field type

backend/poetry.lock

Lines changed: 90 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ sqlalchemy = "^2.0.29"
2424
django-admin-thumbnails = "^0.2.8"
2525
drf-yasg = "^1.21.7"
2626
django-cors-headers = "^4.3.1"
27+
django-storages = "^1.14.2"
28+
boto3 = "^1.34.93"
2729

2830

2931
[build-system]

0 commit comments

Comments
 (0)