In this video, we'll deep dive into integrating Django's media file utilities with cloud providers - namely Amazon S3 buckets and Amazon CloudFront distributions.
We'll configure django-storages to store uploaded files in an S3 bucket, with signed URLs of a configurable expiry time.
We'll then see how to add a CloudFront distribution with our S3 bucket as its origin, and how to configure CloudFront to generate signed URLs using key groups and public keys.
📌 𝗖𝗵𝗮𝗽𝘁𝗲𝗿𝘀:
00:00 Intro
01:58 Installing Django-storages
05:30 Creating IAM User and Group
07:08 Creating AWS User Access Key and Secret Access Key
09:25 Creating S3 Bucket to Store Django Media Files
11:41 Reading env file with django-environ
17:35 Changing S3 URL expiration time with Django-storages
19:52 Creating a CloudFront distribution with S3 origin
24:16 Adding Bucket Policy to S3 Origin to Allow CloudFront access
27:31 Using CloudFront distribution to serve assets in Django
29:49 Signed URLs with CloudFront and Django
☕️ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲:
To support the channel and encourage new videos, please consider buying me a coffee here:
https://ko-fi.com/bugbytes
▶️ Full Playlist:
https://www.youtube.com/playlist?list=PL-2EBeDYMIbQpw0N1BmAi9-acwhpxEfoo
𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:
📖 Blog: https://bugbytes.io/posts/
👾 Github: https://github.com/bugbytes-io/
🐦 Twitter: https://twitter.com/bugbytesio
📚 𝗙𝘂𝗿𝘁𝗵𝗲𝗿 𝗿𝗲𝗮𝗱𝗶𝗻𝗴 𝗮𝗻𝗱 𝗶𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻:
MAmazon S3:
S3 with Django-storages: https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html
Cloudfront with Django-Storages: https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#cloudfront
RSA Key Generator: https://travistidwell.com/jsencrypt/demo/
#python #django #aws #s3 #cloudfront