Django Storages S3 shows Claude how to move static and media files to AWS S3 with django-storages and boto3. It covers the Django 4.2+ STORAGES dict, separate prefixes for static and media, environment-loaded credentials and bucket-policy access without object ACLs.
Four reference files cover settings and CloudFront, public and private custom backends, presigned download and upload URLs, and testing with InMemoryStorage or moto plus a minimum IAM policy. A checklist helps audit an existing configuration.
What You Get
- A STORAGES configuration with separate media and static locations
- Public and private storage backends attached to model fields
- Presigned GET URLs and presigned POST uploads for direct browser-to-S3 transfer
- A least-privilege IAM policy and CloudFront settings
- Tests that run against InMemoryStorage or moto and never touch AWS
Common Use Cases
- Moving FileField and ImageField uploads from local disk to S3
- Serving private documents through expiring presigned links
- Putting CloudFront in front of a bucket for static and media files
- Auditing an existing project for hardcoded keys and removed storage settings
What Makes It Unique
It is specific to django-storages pitfalls: object ACLs fail on buckets created after April 2023, a custom domain breaks presigned URLs, DEFAULT_FILE_STORAGE is ignored from Django 5.1, a STORAGES override must define both default and staticfiles, and file_overwrite=False leaves replaced files behind. Each is written as a rule or a checklist step.
Under The Hood
The skill is a SKILL.md with four reference files and no scripts. The workflow tells the agent to install packages with pip, run collectstatic and confirm that uploads reach S3. The audit checklist uses grep over the settings folder to look for hardcoded keys. The code samples call AWS through boto3 to sign URLs and show an IAM policy and CloudFront keys, all read from environment variables. The skill itself does not fetch web pages.