Ir al contenido

Admin

The local superuser owns the Django admin panel and the full ADMIN role across the API.

[!info] Authority Superuser variables and their fallback rules live in [[adr-006-environment-variables|ADR-006]]. Roles live in [[adr-014-user-entity|ADR-014]]. This page is operational only.

FieldDefault value
Email (USERNAME_FIELD)[email protected]
PasswordVanevan3
Given / Family nameKodex / Admin
RoleADMIN

These are the development defaults declared in .env.example and mirrored as Compose fallbacks in docker-compose.yml. They are dev-only — production injects them from AWS (see [[adr-006-environment-variables|ADR-006]]).

On every boot, backend/entrypoint.sh step [2/6] runs the management command create_superuser, which is driven entirely by environment variables:

VariableRequired?
SUPERUSER_PASSWORDYes — command is skipped if unset
SUPERUSER_EMAILYes — command errors if unset
SUPERUSER_GIVEN_NAMEYes — command errors if unset
SUPERUSER_FAMILY_NAMEYes — command errors if unset

The command is idempotent: it get_or_creates by email, so restarts never duplicate the user. It is distinct from mock-data seeding ([[mock-data|Mock Data]]) — the superuser is auth, not fixture data, and is created in both local and production modes.

  • Django admin: http://localhost:8000/admin/ — email + password.
  • API: authenticate via the cookie-JWT flow in [[adr-008-authentication|ADR-008]] (POST /api/v1/auth/login/).
  1. Edit the SUPERUSER_* values in your local .env (copied from .env.example).
  2. docker compose up -d (or restart api). The command re-runs and applies the new identity.

[!note] Changing the email creates a new user create_superuser keys on email. Changing SUPERUSER_EMAIL creates a second superuser rather than renaming the first. To fully reset, docker compose down -v (wipes the DB) and boot fresh.