Part 16 of a FastAPI series covering how to migrate file uploads from local disk storage to AWS S3 using Boto3. Topics include creating an S3 bucket with proper IAM policies and bucket policies, installing and configuring Boto3, refactoring image processing to return bytes instead of saving to disk, writing async upload/delete wrappers using run_in_threadpool to avoid blocking the event loop, updating user models to return S3 URLs, and removing the local media mount from FastAPI. Includes a diagnostic script to verify S3 credentials and permissions, and troubleshooting tips for common errors like 403 forbidden or failed deletes.

47m watch time

Sort: