Skip to content

Commit 64c2096

Browse files
committed
update: static 파일을 S3에 저장하도록 수정 (dev, prod)
1 parent 8801ed5 commit 64c2096

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

pyconkr/settings-dev.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,10 @@
1313
"PORT": os.getenv("AWS_RDS_PORT"),
1414
}
1515
}
16+
17+
# django-storages: S3
18+
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
19+
STATICFILES_STORAGE = 'storages.backends.s3boto3.S3StaticStorage'
20+
AWS_S3_ACCESS_KEY_ID = os.getenv("AWS_S3_ACCESS_KEY_ID")
21+
AWS_S3_SECRET_ACCESS_KEY = os.getenv("AWS_S3_SECRET_ACCESS_KEY")
22+
AWS_STORAGE_BUCKET_NAME = "pyconkr-api-v2-static-dev"

pyconkr/settings-prod.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,10 @@
1313
"PORT": os.getenv("AWS_RDS_PORT"),
1414
}
1515
}
16+
17+
# django-storages: S3
18+
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
19+
STATICFILES_STORAGE = 'storages.backends.s3boto3.S3StaticStorage'
20+
AWS_S3_ACCESS_KEY_ID = os.getenv("AWS_S3_ACCESS_KEY_ID")
21+
AWS_S3_SECRET_ACCESS_KEY = os.getenv("AWS_S3_SECRET_ACCESS_KEY")
22+
AWS_STORAGE_BUCKET_NAME = "pyconkr-api-v2-static"

pyconkr/settings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,16 @@
106106
# Internationalization
107107
# https://docs.djangoproject.com/en/4.1/topics/i18n/
108108

109-
LANGUAGE_CODE = "en-us"
109+
LANGUAGE_CODE = "ko-KR"
110110

111-
TIME_ZONE = "UTC"
111+
TIME_ZONE = "Asia/Seoul"
112112

113113
USE_I18N = True
114114

115115
USE_TZ = True
116116

117117

118-
# Static files (CSS, JavaScript, Images)
118+
# Static files (CSS, JavaScript, Images) (w/ django-storages)
119119
# https://docs.djangoproject.com/en/4.1/howto/static-files/
120120

121121
STATIC_URL = "static/"

0 commit comments

Comments
 (0)