Agent skill

Django Storages for S3

by Jeffallan in Jeffallan/claude-skills

Sets up Django 4.2+ to keep static and media files on AWS S3 through django-storages, with public and private backends, presigned URLs and CloudFront.

MITAuto-check passedBackend & APIs

Install Django Storages for S3

skills CLI
$ npx skills add Jeffallan/claude-skills --skill django-storages-s3 -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Jeffallan/claude-skills django-storages-s3 --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Jeffallan/claude-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/django-storages-s3 .claude/skills/django-storages-s3 && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
django-storages-s3
GitHub stars
12k
Token cost
~1.9k tokens
SKILL.md length
635 words
Files
5 (incl. references)
Skills in repo
58
Repo updated
First seen
Licence
MIT

At a glance

Sets up Django 4.2+ to keep static and media files on AWS S3 through django-storages, with public and private backends, presigned URLs and CloudFront.

  • Works in 5 steps: Install & register — pip install… → Configure credentials — Load from env… → Wire the STORAGES dict — Set default… → …
  • Moving Django static and media files from local disk to an S3 bucket
  • SKILL.md covers When to Use This Skill, Core Workflow, Reference Guide and Minimal Working Example, plus 4 more sections
  • Calls pip; needs AWS_SECRET_ACCESS_KEY

What it does

This skill walks the agent through installing django-storages and boto3, registering the app, and wiring the Django 4.2+ STORAGES dict so uploads and collected static files land under separate prefixes in an S3 bucket. Credentials come from environment variables or an attached IAM role, and the skill says never to hardcode them.

Reference files cover splitting public and private backends, per-field storage, generating presigned download and direct browser upload URLs, fronting the bucket with CloudFront, and writing a least-privilege IAM policy. For tests it points to InMemoryStorage or moto so storage code runs without reaching S3. It also includes a checklist for auditing a project that already uses S3.

When your agent uses it

  • Moving Django static and media files from local disk to an S3 bucket
  • Splitting public CDN-served files from private files served by presigned URLs
  • Adding direct browser-to-S3 uploads to a Django form or API
  • Writing tests for storage code without calling real S3
  • Auditing an existing S3 storage setup in settings.py

Example prompts

  • “Move our Django media uploads to S3 using the new STORAGES setting and keep static files under a separate prefix.”
  • “Add a private bucket backend for invoices and return presigned download links that expire quickly.”
  • “Replace the S3 calls in our upload tests with InMemoryStorage.”
  • “Review settings.py and tell me whether our S3 configuration follows least-privilege IAM practice.”

Requirements

  • Python with `django-storages` and `boto3`
  • An AWS S3 bucket and credentials or an IAM role

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Install & register — pip install django-storages[s3] boto3; add "storages" to INSTALLED_APPS
  2. Configure credentials — Load from env vars or rely on an attached IAM role; never hardcode
  3. Wire the STORAGES dict — Set default (media) and staticfiles backends with separate location prefixes
  4. Add named backends — Split public vs. private buckets/ACLs as additional STORAGES entries when needed
  5. Verify & test — Run collectstatic, confirm uploads land in S3, and mock S3 in tests with InMemoryStorage or moto

What it can do on your machine

Read from SKILL.md and the folder at commit 1be15d8. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • jeffallan.github.io

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • AWS_SECRET_ACCESS_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Django Storages for S3 loads about 1.9k tokens when it runs, and up to ~6.8k if it reads all its reference files. Until then it costs about 133 tokens; SKILL.md has 635 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~133
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~6.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Jeffallan/claude-skills at commit 1be15d8, republished under its MIT licence (© Jeffallan). 635 words, ~1,856 tokens.

Download SKILL.mdSave it as .claude/skills/django-storages-s3/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
django-storages-s3
description
Use when configuring Django to store static and media files on AWS S3 with django-storages. Invoke when working with the STORAGES setting, S3 buckets, presigned URLs, CloudFront, or boto3-backed file storage in settings.py. Configures the Django 4.2+ STORAGES dict, public/private custom backends, presigned GET/POST URLs, IAM policies, and S3 mocking for tests. Trigger terms: django-storages, S3, boto3, S3Boto3Storage, STORAGES, presigned URL, CloudFront, media files, collectstatic, AWS_STORAGE_BUCKET_NAME.
license
MIT
metadata.author
https://github.com/awais786
metadata.version
1.0.0
metadata.domain
backend
metadata.triggers
django-storages, S3, boto3, S3Boto3Storage, STORAGES, presigned URL, CloudFront, media files, collectstatic
metadata.role
specialist
metadata.scope
implementation
metadata.output-format
code
metadata.related-skills
django-expert

Django Storages S3

Senior Django specialist for production-grade file storage on AWS S3 via django-storages and boto3 — public and private media, static files, presigned URLs, and CloudFront.

When to Use This Skill

  • Serving static and/or media files from AWS S3 instead of the local filesystem
  • Configuring the Django 4.2+ STORAGES dict or legacy DEFAULT_FILE_STORAGE
  • Separating public (CDN-served) and private (presigned) file backends
  • Generating presigned download or direct browser-to-S3 upload URLs
  • Fronting S3 with CloudFront and writing a least-privilege IAM policy
  • Migrating local FileField/ImageField storage to S3 without code changes
  • Testing storage code without hitting S3

Core Workflow

  1. Install & register — pip install django-storages[s3] boto3; add "storages" to INSTALLED_APPS
  2. Configure credentials — Load from env vars or rely on an attached IAM role; never hardcode
  3. Wire the STORAGES dict — Set default (media) and staticfiles backends with separate location prefixes
  4. Add named backends — Split public vs. private buckets/ACLs as additional STORAGES entries when needed
  5. Verify & test — Run collectstatic, confirm uploads land in S3, and mock S3 in tests with InMemoryStorage or moto

Reference Guide

Load detailed guidance based on context:

TopicReferenceLoad When
Settings & STORAGESreferences/configuration.mdCore settings, 4.2+ vs legacy, CloudFront
Custom backendsreferences/custom-backends.mdPublic vs. private buckets, per-field storage
Presigned URLsreferences/presigned-urls.mdDownload links, direct browser uploads
Testing & IAMreferences/testing-storages.mdMocking S3, IAM policy, common pitfalls

Minimal Working Example

The snippet below demonstrates the core MUST DO constraints: env-loaded credentials, STORAGES dict, separate media/static locations, and default_acl=None on the media backend.

python
# settings.py
import os

AWS_STORAGE_BUCKET_NAME = os.environ["AWS_STORAGE_BUCKET_NAME"]
AWS_S3_REGION_NAME = os.environ.get("AWS_S3_REGION_NAME", "us-east-1")
AWS_S3_CUSTOM_DOMAIN = f"{AWS_STORAGE_BUCKET_NAME}.s3.{AWS_S3_REGION_NAME}.amazonaws.com"
# On EC2/ECS/Lambda, omit keys entirely — boto3 uses the attached IAM role.

STORAGES = {
    "default": {  # media uploads
        "BACKEND": "storages.backends.s3boto3.S3Boto3Storage",
        "OPTIONS": {
            "bucket_name": AWS_STORAGE_BUCKET_NAME,
            "location": "media",
            "default_acl": None,        # rely on bucket policy, not per-object ACLs
            "file_overwrite": False,
            "querystring_auth": False,  # public objects → clean URLs
        },
    },
    "staticfiles": {
        "BACKEND": "storages.backends.s3boto3.S3StaticStorage",
        "OPTIONS": {
            "bucket_name": AWS_STORAGE_BUCKET_NAME,
            "location": "static",
        },
    },
}

MEDIA_URL = f"https://{AWS_S3_CUSTOM_DOMAIN}/media/"
STATIC_URL = f"https://{AWS_S3_CUSTOM_DOMAIN}/static/"
python
# models.py — uploads go straight to S3 on save()
from django.db import models

class Document(models.Model):
    file = models.FileField(upload_to="docs/")  # uses STORAGES["default"]

Auditing an Existing Configuration

When reviewing a project that already uses S3 (not greenfield), walk this checklist — each item is a constraint below rephrased as "find X, confirm Y":

  1. Credentials — grep -rn "AWS_SECRET_ACCESS_KEY\|aws_secret" settings/ → confirm values come from os.environ/django-environ or an IAM role, never literals committed to the repo.
  2. ACLs — grep -rn "default_acl\|AWS_DEFAULT_ACL" . → on buckets created after April 2023, every value must be None. Any "public-read"/"private" will raise AccessControlListNotSupported; public access belongs in a bucket policy.
  3. Storage backend — confirm Django 4.2+ uses the STORAGES dict, not DEFAULT_FILE_STORAGE/STATICFILES_STORAGE (removed in Django 5.1, so silently ignored on 5.1/5.2/6.0); confirm the static class is S3StaticStorage, not a fabricated name.
  4. Locations — confirm default (media) and staticfiles have distinct location prefixes or buckets so collectstatic never collides with uploads.
  5. Region — confirm region_name (or the global AWS_S3_REGION_NAME) matches the bucket's real region and that AWS_S3_CUSTOM_DOMAIN includes the region segment for non-us-east-1 buckets.
  6. Presigning — for private backends, confirm querystring_auth=True and custom_domain=None; confirm presigned .url() results aren't cached past AWS_QUERYSTRING_EXPIRE.
  7. Overwrite cleanup — where file_overwrite=False, confirm replaced files are explicitly deleted (otherwise superseded objects leak).
  8. IAM — confirm the policy grants only Get/Put/Delete/ListBucket on the bucket ARN, not broader S3 access.
Show full SKILL.md (191 more words)Show less

Constraints

MUST DO
  • Load AWS credentials from environment variables or an attached IAM role
  • Set default_acl=None so bucket policies (not object ACLs) control access
  • Give static and media files separate location prefixes or separate buckets
  • Use the STORAGES dict on Django 4.2+ (same config through 5.2 LTS and 6.0); DEFAULT_FILE_STORAGE/STATICFILES_STORAGE were removed in 5.1, so reserve them for < 4.2 only
  • Set custom_domain=None on any backend that issues presigned URLs
  • Mock S3 (InMemoryStorage or moto) in tests instead of hitting real buckets
MUST NOT DO
  • Hardcode AWS_SECRET_ACCESS_KEY in settings.py or commit it
  • Mix querystring_auth=True with a custom_domain (presigning breaks)
  • Mix static and media files under the same prefix
  • Grant the IAM user broader than Get/Put/Delete/ListBucket on the bucket ARN
  • Rely on per-object ACLs on buckets created after April 2023 (ACLs disabled by default)

Knowledge Reference

django-storages, S3Boto3Storage, S3StaticStorage, boto3, STORAGES dict, presigned URLs, generate_presigned_post, CloudFront, IAM policy, InMemoryStorage, moto

  • django-expert — core Django models, DRF, and ORM that produce the files this skill persists to S3
  • fullstack-guardian — secure end-to-end upload flows and access control around stored files
  • devops-engineer — provisioning the S3 buckets, IAM roles, and CloudFront distributions this skill targets

Documentation

© Jeffallan, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (references) in skills/django-storages-s3 of Jeffallan/claude-skills.

  • SKILL.md
  • references/configuration.md
  • references/custom-backends.md
  • references/presigned-urls.md
  • references/testing-storages.md

Open the folder on GitHubat commit 1be15d8

Compare with similar skills

Django Storages for S3 next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Django Storages for S3 compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Django Storages for S3 this skillJeffallan/claude-skills12k—~1.9kAutomated safety check: PassMIT
Processing S3 Uploads With Step Functionsaws/agent-toolkit-for-aws2.8k—~4kAutomated safety check: PassApache-2.0
Neon Object Storageneondatabase/agent-skills100—~3.5kAutomated safety check: NotesApache-2.0
AWS S3sickn33/agentic-awesome-skills47k2 repos~3.1kAutomated safety check: PassMIT
S3itsmostafa/aws-agent-skills1.2k—~2.3kAutomated safety check: PassMIT
Remediating S3 Bucket Misconfigurationmukul975/Anthropic-Cybersecurity-Skills34k—~3kAutomated safety check: PassApache-2.0

Similar skills

  • Official

    Deploy an event-driven workflow that routes S3 uploads to either Lambda or Fargate via Step Functions based on file size.

    2.8k GitHub stars~4k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Neon Object Storage

    neondatabase/agent-skills

    Official

    S3-compatible object storage that branches with your Neon project, so files and the database stay in sync across every branch.

    100 GitHub stars~3.5k tokensUpdated 2 days ago
    Backend & APIsAuto-check: notes
  • AWS S3

    sickn33/agentic-awesome-skills

    Configure S3 buckets, policies, and lifecycle rules. An agent skill from sickn33/agentic-awesome-skills.

    47k GitHub starsUsed in 2 repos~3.1k tokens
    Backend & APIsAuto-check passed
  • S3

    itsmostafa/aws-agent-skills

    AWS S3 object storage for bucket management, object operations, and access control.

    1.2k GitHub stars~2.3k tokensUpdated 5 days ago
    Backend & APIsAuto-check passed
  • Remediating S3 Bucket Misconfiguration

    mukul975/Anthropic-Cybersecurity-Skills

    Provides step-by-step procedures for remediating Amazon S3 bucket misconfigurations that expose sensitive data: enabling S3 Block Public Access, auditing bucket policies and ACLs, enforcing…

    34k GitHub stars~3k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • Creating Data Lake Table

    aws/agent-toolkit-for-aws

    Official

    Create managed Iceberg tables using Amazon S3 Tables (s3tables API namespace) with automatic compaction and snapshot management.

    2.8k GitHub starsUsed in 1 repo~2.1k tokens
    Backend & APIsAuto-check passed

More from Jeffallan/claude-skills

All 58 skills in this repo
  • API Designer

    Jeffallan/claude-skills

    Designs REST and GraphQL APIs from resource modeling to an OpenAPI 3.1 contract, with versioning, pagination and RFC 7807 error handling.

    12k GitHub starsUsed in 1 repo~2k tokens
    Auto-check passed
  • CLI Developer

    Jeffallan/claude-skills

    Walks through designing, building and polishing a command-line tool: user workflow and command hierarchy, implementation in commander, click, typer or cobra, completions and cross-platform testing.

    12k GitHub starsUsed in 1 repo~1.2k tokens
    Auto-check passed
  • Kubernetes Specialist

    Jeffallan/claude-skills

    Creates and checks Kubernetes manifests, Helm charts, RBAC and network policies, and helps debug pod problems, with kubectl checks and rollback steps.

    12k GitHub starsUsed in 1 repo~2.1k tokens
    Auto-check passed
  • Laravel Specialist

    Jeffallan/claude-skills

    Builds Laravel 10+ applications with Eloquent models, Sanctum authentication, Horizon queues, API resources and Livewire components, tested with Pest or PHPUnit.

    12k GitHub starsUsed in 1 repo~2.1k tokens
    Auto-check passed
  • Pandas Pro

    Jeffallan/claude-skills

    Handles pandas DataFrame work: cleaning, merging, groupby aggregation, pivots, time-series resampling and memory tuning, with checks on dtypes, shapes and nulls.

    12k GitHub starsUsed in 1 repo~1.5k tokens
    Auto-check passed
  • Apache Spark Engineer

    Jeffallan/claude-skills

    Guides writing and tuning Apache Spark jobs: DataFrame and RDD code, Spark SQL, partitioning, caching, shuffle tuning and structured streaming.

    12k GitHub starsUsed in 1 repo~1.7k tokens
    Auto-check passed

Categories

Questions about Django Storages for S3

What does Django Storages for S3 do?

Sets up Django 4.2+ to keep static and media files on AWS S3 through django-storages, with public and private backends, presigned URLs and CloudFront. 2+ STORAGES dict so uploads and collected static files land under separate prefixes in an S3 bucket. Credentials come from environment variables or an attached IAM role, and the skill says never to hardcode them.

When should I use Django Storages for S3?

Django Storages for S3 fits situations like: moving Django static and media files from local disk to an S3 bucket; splitting public CDN-served files from private files served by presigned URLs; adding direct browser-to-S3 uploads to a Django form or API; writing tests for storage code without calling real S3.

How do I install Django Storages for S3 in Claude Code?

Run `npx skills add Jeffallan/claude-skills --skill django-storages-s3 -a claude-code`. Or copy the skill folder (skills/django-storages-s3 in Jeffallan/claude-skills) into .claude/skills/django-storages-s3 in your project. Claude Code loads it when a task matches its description.

How do I install Django Storages for S3 in Codex?

Run `npx skills add Jeffallan/claude-skills --skill django-storages-s3 -a codex`. Or copy the skill folder (skills/django-storages-s3 in Jeffallan/claude-skills) into .agents/skills/django-storages-s3 in your project. Codex loads it when a task matches its description.

Can I use Django Storages for S3 in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Jeffallan/claude-skills --skill django-storages-s3 -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/django-storages-s3, .gemini/skills/django-storages-s3, .github/skills/django-storages-s3 and .opencode/skills/django-storages-s3 in your project.

What does Django Storages for S3 need to run?

Going by SKILL.md and its folder, Django Storages for S3 needs the command-line tools its instructions call (pip) and credentials named AWS_SECRET_ACCESS_KEY. Our summary lists: Python with `django-storages` and `boto3`; An AWS S3 bucket and credentials or an IAM role.

Does Django Storages for S3 access the network?

SKILL.md names 1 domain. As links in the text: jeffallan.github.io. This is read from the text; nothing was executed.

Is Django Storages for S3 safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Django Storages for S3 use?

Django Storages for S3 is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Django Storages for S3 use?

About 1.9k tokens (SKILL.md is roughly 7.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 4.9k tokens, read only when the agent opens those files.

What are the alternatives to Django Storages for S3?

Skills that share tags, products or a category with Django Storages for S3: Processing S3 Uploads With Step Functions (aws/agent-toolkit-for-aws, 2.8k stars), Neon Object Storage (neondatabase/agent-skills, 100 stars), AWS S3 (sickn33/agentic-awesome-skills, 47k stars) and S3 (itsmostafa/aws-agent-skills, 1.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Django Storages for S3?

Jeffallan (a GitHub user) maintains it in Jeffallan/claude-skills, which has 11,802 GitHub stars. The repository holds 58 skills in this directory. The repository was last updated on October 3, 2026.

Source: Jeffallan/claude-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.