Skip to content

viewflow/seedkit / skills/django-seedkit

django-seedkit

Flagged

Bootstrap a new Django project, or add components — auth (allauth, magic-link, axes, 2FA), payments (Stripe, dj-stripe), REST (django-modern-rest, django-bolt), Celery / Django Tasks, async views & WebSockets (ASGI, uvicorn worker, django-channels, channels-redis), Tailwind+DaisyUI, favicon, SEO meta tags + sitemap, HTML email templates, S3 storage, structlog, healthchecks, Docker, CI, deploy (VPS / Fly / GitHub-SSH), dbbackup, Sentry/Bugsink — to an existing Django codebase. Use whenever the user wants to scaffold Django, integrate a Django package, set up async / WebSockets, set up production deploys, wire CI/CD, or extend an existing Django project.

FileKindSize
SKILL.mdskill md17.7 KB
references/analytics.mdmarkdown6.3 KB
references/async.mdmarkdown4.4 KB
references/auth-hardening.mdmarkdown4.3 KB
references/auth.mdmarkdown7.9 KB
references/billing.mdmarkdown10.6 KB
references/ci.mdmarkdown3.9 KB
references/conventions.mdmarkdown2.5 KB
references/cors.mdmarkdown2.3 KB
references/csp.mdmarkdown3.6 KB
references/custom-user.mdmarkdown5.6 KB
references/database.mdmarkdown7.4 KB
references/dbbackup.mdmarkdown5.0 KB
references/deploy-github-ssh.mdmarkdown6.4 KB
references/deploy-managed.mdmarkdown2.9 KB
references/deploy-vps.mdmarkdown7.0 KB
references/dev-tasks.mdmarkdown6.5 KB
references/dev-tools.mdmarkdown14.5 KB
references/devcontainer.mdmarkdown2.1 KB
references/docker.mdmarkdown15.0 KB
references/email.mdmarkdown3.9 KB
references/error-reporting.mdmarkdown3.7 KB
references/existing-project.mdmarkdown4.7 KB
references/favicon.mdmarkdown2.7 KB
references/gdpr.mdmarkdown3.9 KB
references/healthcheck.mdmarkdown2.3 KB
references/i18n.mdmarkdown4.1 KB
references/lint.mdmarkdown2.2 KB
references/logging.mdmarkdown3.9 KB
references/new-project.mdmarkdown7.2 KB
references/pre-commit.mdmarkdown3.0 KB
references/pytest.mdmarkdown2.6 KB
references/realtime.mdmarkdown8.6 KB
references/redis.mdmarkdown2.6 KB
references/rest-bolt.mdmarkdown7.4 KB
references/rest-modern-rest.mdmarkdown3.4 KB
references/rest.mdmarkdown2.7 KB
references/robots.mdmarkdown1.8 KB
references/security.mdmarkdown2.0 KB
references/seo.mdmarkdown3.1 KB
references/storage-s3.mdmarkdown7.7 KB
references/storage-whitenoise.mdmarkdown2.8 KB
references/tailwind.mdmarkdown11.6 KB
references/tasks-celery.mdmarkdown5.3 KB
references/tasks-django-cron.mdmarkdown1012 B
references/tasks-django.mdmarkdown1.2 KB
references/typecheck.mdmarkdown4.3 KB
references/uv.mdmarkdown670 B

references/deploy-github-ssh.md

View on GitHub
# Deploy — GitHub Actions via SSH

Docs: <https://docs.github.com/en/actions> · <https://github.com/appleboy/ssh-action>

This pattern is built on top of `references/deploy-vps.md`. Read that first
— this file only adds the GitHub Actions wrapper. In particular, it inherits
`docker-compose.prod.yml`, the Caddy reverse proxy, and the `/healthz`
container healthcheck.

One change to the inherited `docker-compose.prod.yml`: the `web` image line is
built and pushed by CI, and the owner isn't known at scaffold time. Point it at
the exported env vars, not a hardcoded `{owner}/{project_slug}`:

```yaml
    image: ghcr.io/${GITHUB_REPOSITORY}:${IMAGE_TAG:-latest}
```

The deploy workflow exports `IMAGE_TAG` as the commit SHA, so every deploy is
addressable and `## Rollback` below can pin any previous one; manual compose
calls without the var fall back to `:latest`.

## Secrets

Set in repo settings:
- `SSH_HOST`
- `SSH_USER`
- `SSH_KEY`
- `GHCR_TOKEN` — a PAT with `read:packages`, used by the **server** to pull
  private images. `${{ secrets.GITHUB_TOKEN }}` is only valid inside Actions;
  the VPS needs its own credential.

## deploy/.env.prod.example — ship this in the repo

`references/deploy-vps.md` defines the base template. Append one section for
the GHCR image path:

```sh
# Image
GITHUB_REPOSITORY=owner/repo        # the GHCR image path
```

`IMAGE_TAG` is not listed — the deploy workflow exports it as the commit SHA and
the compose file falls back to `:latest`.

## .github/workflows/deploy.yml

```yaml
name: deploy

on:
  push:
    branches: [main]

# Two pushes in quick succession must serialize, not race on the same host.
concurrency:
  group: deploy
  cancel-in-progress: false

permissions:
  contents: read
  packages: write

jobs:
  # The gate: red tests never reach the server. Requires the `workflow_call`
  # trigger on test.yml (references/ci.md). If CI wasn't applied, drop this
  # job and the `needs: test` line.
  test:
    uses: ./.github/workflows/test.yml

  deploy:
    needs: test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7

      - uses: docker/login-action@v4
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

      - uses: docker/build-push-action@v7
        with:
          push: true
          # :latest for humans, :<sha> so every deploy stays pullable for rollback.
          tags: |
            ghcr.io/${{ github.repository }}:latest
            ghcr.io/${{ github.repository }}:${{ github.sha }}
          target: prod                              # matches the `prod` stage in references/docker.md
          build-args: |
            GIT_SHA=${{ github.sha }}                # feeds SENTRY_RELEASE (references/error-reporting.md)

      # Pin third-party deploy actions to a commit SHA, not a tag — this step
      # runs arbitrary shell on prod. Resolve the SHA of the latest release:
      #   gh api repos/appleboy/ssh-action/git/ref/tags/<latest-tag> --jq .object.sha
      - uses: appleboy/ssh-action@<SHA>  # v1.2.5
        with:
          host: ${{ secrets.SSH_HOST }}
          username: ${{ secrets.SSH_USER }}
          key: ${{ secrets.SSH_KEY }}
          script: |
            set -euo pipefail
            cd /srv/{project_slug}
            # Compose reads `${GITHUB_REPOSITORY}` from the shell env, not
            # `env_file:`. Without the export `compose pull` resolves to
            # `ghcr.io/:latest`. `--env-file deploy/.env.prod` is required
            # on every compose call — auto-`.env` discovery only loads
            # `.env`, not `deploy/.env.prod`.
            export GITHUB_REPOSITORY="${{ github.repository }}"
            export IMAGE_TAG="${{ github.sha }}"
            # Server-side docker login for the private ghcr image.
            echo "${{ secrets.GHCR_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
            docker compose --env-file deploy/.env.prod -f deploy/docker-compose.prod.yml pull
            docker compose --env-file deploy/.env.prod -f deploy/docker-compose.prod.yml run --rm web python manage.py migrate
            docker compose --env-file deploy/.env.prod -f deploy/docker-compose.prod.yml up -d
            # Wait for the container healthcheck (defined in deploy-vps.md)
            # to flip to "healthy" — don't sleep-and-curl on plain HTTP if
            # SECURE_SSL_REDIRECT is on, that returns 301 and `curl` without
            # `-L` reads success regardless of the upstream actually being up.
            status=starting
            for i in $(seq 1 30); do
              status=$(docker inspect -f '{{.State.Health.Status}}' \
                $(docker compose --env-file deploy/.env.prod -f deploy/docker-compose.prod.yml ps -q web) 2>/dev/null || echo starting)
              [ "$status" = "healthy" ] && break
              sleep 2
            done
            [ "$status" = "healthy" ] || { echo "web never became healthy"; exit 1; }
            # Prune only after a healthy deploy — old :latest layers otherwise
            # accumulate until the disk fills.
            docker image prune -f
```

When this reference is applied together with `references/ci.md`, remove the
`push:` trigger from `test.yml` — the deploy workflow already runs it on every
main push via `workflow_call`, and both triggers firing doubles every CI run.

## Rollback

Every deploy is tagged with its commit SHA, and the deploy script prunes images
only after a healthy deploy — so the previous image is still pullable when a
deploy goes bad:

```sh
ssh user@vps
cd /srv/{project_slug}
export GITHUB_REPOSITORY=owner/repo IMAGE_TAG=<known-good commit sha>
docker compose --env-file deploy/.env.prod -f deploy/docker-compose.prod.yml pull web
docker compose --env-file deploy/.env.prod -f deploy/docker-compose.prod.yml up -d web
```

Migrations are not auto-reversed: rolling back assumes the old code runs against
the current schema, which holds for additive migrations. If the bad deploy
shipped a destructive migration, reverse it explicitly (`manage.py migrate <app>
<previous_migration>`) before `up -d`.

## Test workflow — also pin `DJANGO_SETTINGS_MODULE`

`references/pytest.md` pins `DJANGO_SETTINGS_MODULE = config.settings.test`
in the pytest config — CI inherits it, no test-job override needed. Keep the
`manage.py check --deploy` step against `config.settings.production`
(`references/ci.md`) so regressions in security settings (SSL_REDIRECT
without proxy, missing HSTS, etc.) fail CI rather than first-deploy.
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 319kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 118kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall