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/auth.md

View on GitHub
# Authentication

Docs: <https://docs.allauth.org/> · <https://django-mail-auth.readthedocs.io/>

Stock Django ships barebones login/logout views and a `User` model. Pick one add-on:

- **`django-allauth`** — full account flows: signup, email verification, password reset, optional social providers (Google / GitHub), 2FA. The most-used auth library in the Django ecosystem.
- **`django-mail-auth`** — passwordless magic-link. Single tiny dependency, no passwords, no social providers.

If "no auth add-on", skip this reference.

Email backend (`references/email.md`) must be configured first — both options send mail.

---

## Option A — `django-allauth`

### Install

```sh
uv add django-allauth
```

### Settings — `base.py`

Append rather than redeclare so `production.py` overrides (WhiteNoise position, CSP middleware) survive:

```python
INSTALLED_APPS += [
    "django.contrib.sites",
    "allauth",
    "allauth.account",
    # "allauth.socialaccount",   # uncomment for social providers
]

MIDDLEWARE += ["allauth.account.middleware.AccountMiddleware"]

AUTHENTICATION_BACKENDS = [
    "django.contrib.auth.backends.ModelBackend",
    "allauth.account.auth_backends.AuthenticationBackend",
]

SITE_ID = 1
LOGIN_REDIRECT_URL = "/"           # don't send non-staff users to /admin/
                                   # — they bounce to a re-login screen.
                                   # The root view can redirect to /admin/
                                   # for now; replace once a real landing
                                   # page lands.
LOGOUT_REDIRECT_URL = "/accounts/login/"

ACCOUNT_LOGIN_METHODS = {"email"}
ACCOUNT_SIGNUP_FIELDS = ["email*", "password1*", "password2*"]
ACCOUNT_EMAIL_VERIFICATION = "optional"   # tightened in production
```

In `production.py` (or gate on `not DEBUG`):

```python
ACCOUNT_EMAIL_VERIFICATION = "mandatory"
```

Mandatory + console email = verification link only in `runserver` stdout — fine in prod with real SMTP, painful for local signup.

### URLs

```python
urlpatterns = [
    ...
    path("accounts/", include("allauth.urls")),
]
```

### Migrate

```sh
uv run manage.py migrate
```

`django.contrib.sites` ships a default Site row (`pk=1`, `domain="example.com"`) used for absolute URLs in verification / password-reset emails. Update it per environment via admin (`/admin/sites/site/1/`) or a data migration reading `DJANGO_SITE_DOMAIN` from env. Forgetting it sends links pointing at `example.com`.

Allauth ships its own templates; override only for branding.

### With a custom user model

If `references/custom-user.md` is applied, use the email-as-`USERNAME_FIELD` variant — `AbstractUser` requires a username, so plain subclassing fails email-only signup. Also add:

```python
ACCOUNT_USER_MODEL_USERNAME_FIELD = None
```

Without it, allauth's `get_username_max_length()` calls `User._meta.get_field("username")` and `/accounts/signup/` raises `FieldDoesNotExist`.

---

## Option B — `django-mail-auth`

User enters email → gets a one-time link → clicks → logged in. Three pieces ship in one package:

- `mailauth` — backend + `/accounts/login/` views (required)
- `mailauth.contrib.admin` — replaces Django admin's password login with the same magic-link flow (recommended)
- `mailauth.contrib.user` — provides an `EmailUser` model with `email` as `USERNAME_FIELD` and no password column (alternative to writing your own custom user)

### Install

```sh
uv add django-mail-auth
```

### User model — pick one route

Decide before the first migration. The choice mirrors `references/custom-user.md`:

- **`mailauth.contrib.user`** (simplest, no custom code). Add the app and `AUTH_USER_MODEL = "mailauth_user.EmailUser"`. Skip `custom-user.md` entirely.
- **Your own custom user** (`references/custom-user.md` email-only variant). Keep `users.User` as `AUTH_USER_MODEL`; mailauth works against any model with an `email` field.
- **Stock `auth.User`**. Works, but stock `auth.User.email` has no `unique=True`, and `MailAuthBackend.authenticate()` silently picks the first match when two users share an address — anyone who can sign up twice can hijack the other user's magic-link login. If you stay on stock `auth.User`, add a `UniqueConstraint` via a data migration *and* an admin-side validator. Easier path: pick `mailauth.contrib.user` (handles uniqueness for you) or the email-only custom user from `references/custom-user.md`.

### Settings

```python
# `mailauth.contrib.admin` MUST come before `django.contrib.admin` —
# Django resolves admin templates / login view in app order, so the
# overriding app has to load first. After-ordering silently leaves the
# stock password-login admin in place. This requires editing the
# existing INSTALLED_APPS list in place rather than appending.
INSTALLED_APPS = [
    # ... existing prefix entries kept ...
    "mailauth.contrib.admin",       # admin login → magic link too
    "django.contrib.admin",         # already present from startproject
    # ... other contrib apps ...
    "mailauth",
    "config.apps.MailAuthUserConfig",   # only if EmailUser route picked
]

AUTHENTICATION_BACKENDS = [
    "mailauth.backends.MailAuthBackend",
    # Drop ModelBackend if no password support is needed (the EmailUser
    # route has no password column, so it can never authenticate anyway).
    "django.contrib.auth.backends.ModelBackend",
]

# Only when the EmailUser route is picked:
AUTH_USER_MODEL = "mailauth_user.EmailUser"

LOGIN_URL = "mailauth:login"
LOGIN_REDIRECT_URL = "/"            # see Option A — don't dump non-staff
                                    # users on /admin/.
```

`mailauth.contrib.user`'s `AppConfig` declares no `default_auto_field`, so it
inherits the project's `BigAutoField` and diverges from the `AutoField` primary
key in its own shipped migration. Pin it back:

```python
# config/apps.py
from mailauth.contrib.user.apps import AuthConfig


class MailAuthUserConfig(AuthConfig):
    default_auto_field = "django.db.models.AutoField"
```

Without it every `migrate` warns about unapplied model changes, `makemigrations`
writes a migration into `.venv/` (gone on the next `uv sync`), and CI's
`makemigrations --check` fails.

### URLs

```python
from django.urls import include, path

urlpatterns = [
    ...
    path("accounts/", include("mailauth.urls")),
]
```

No `namespace=...` argument — `app_name = "mailauth"` is already declared inside the package's `urls.py`.

### Templates

mailauth ships the email-body and email-subject templates and *expects you to provide* the HTML pages. All paths live under `templates/registration/` (Django's convention; this is what upstream's views resolve to):

```html
{# templates/registration/login.html — required #}
{% extends "base.html" %}
{% block content %}
<h1>Sign in</h1>
<form method="post">{% csrf_token %}{{ form }}<button>Send link</button></form>
{% endblock %}

{# templates/registration/login_requested.html — required #}
{% extends "base.html" %}
{% block content %}
<h1>Check your inbox</h1>
<p>We sent a sign-in link to that address. The link is valid for a few minutes.</p>
{% endblock %}

{# templates/registration/logged_out.html — required for the logout flow #}
{% extends "base.html" %}
{% block content %}<p>Signed out.</p>{% endblock %}

{# templates/registration/login_email.html — optional; HTML body. If absent, only the package's plain-text body is sent. #}
<a href="{{ code.url }}">Sign in</a>
```

`registration/login_email.txt` and `registration/login_subject.txt` ship inside the package — override them only to customise wording.

Add `BASE_DIR / "templates"` to `TEMPLATES[0]["DIRS"]` if it isn't there already.

### Migrate

```sh
uv run manage.py migrate
```

The package itself ships no models. The migration step exists because the EmailUser route (if picked) creates `mailauth_user.EmailUser` and its initial migration.

### Testing locally

mailauth needs a configured mailer (`references/email.md`). The default local mailer prints the magic link to `runserver` stdout; with Mailpit it lands in the Mailpit UI.
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 322kUpdated 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: 197kUpdated 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: 119kUpdated 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