Skip to content

Commit

Permalink
Merge pull request #84 from dailybruin/fix/s3-bucket-change
Browse files Browse the repository at this point in the history
Set S3 images url from env variables
  • Loading branch information
changyang-liu authored Apr 22, 2022
2 parents 742fefa + 884ee44 commit a10e1a5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions kerckhoff/kerckhoff/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@

S3_SITE_UPLOAD_BUCKET = env('S3_SITE_UPLOAD_BUCKET')
S3_ASSETS_UPLOAD_BUCKET = env('S3_ASSETS_UPLOAD_BUCKET')
S3_DOMAIN_OF_UPLOADED_IMAGES = env('S3_DOMAIN_OF_UPLOADED_IMAGES')
REPOSITORY_FOLDER_ID = env("REPOSITORY_FOLDER_ID")
LIVE_PUSH_SERVER = env('LIVE_PUSH_SERVER')

Expand Down
3 changes: 2 additions & 1 deletion kerckhoff/packages/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from django.conf import settings
from PIL import Image
from requests_oauthlib import OAuth2Session
from django.conf import settings

from .google_drive_actions import get_file

Expand Down Expand Up @@ -80,7 +81,7 @@ def transfer_to_s3(session: OAuth2Session, package):
)

package.images["s3"][image["title"]] = {
"url": "https://assets.dailybruin.com/{0}".format(fn), # TODO: replace with something configurable
"url": f"https://{settings.S3_DOMAIN_OF_UPLOADED_IMAGES}/{fn}",
"key": fn,
"hash": image_hash,
"s3_fields": response
Expand Down

0 comments on commit a10e1a5

Please sign in to comment.