The Django SECRET_KEY is set to a hard-coded string literal in settings.
Why AI tools produce this: AI coding tools generate this anti-pattern by default, it appears in a large share of AI-written auth code.
Why this matters
This is typically the auto-generated django-insecure-... value committed by mistake. SECRET_KEY signs sessions, CSRF tokens and password-reset tokens. Anyone who reads the source or a leaked repo can forge them and bypass authentication entirely (CWE-798).
Load it from the environment or a secret manager instead, e.g. SECRET_KEY = os.environ["SECRET_KEY"], django-environ (env("SECRET_KEY")), or config("SECRET_KEY"). Generate the value with a CSPRNG and never commit it.
Suppressing this rule
If a finding is a genuine false positive, scope the suppression to the exact line and leave a reason, never disable the rule project-wide. Disable directives are line-scoped by design.
# oauthlint-disable-next-line auth.py.secret.django-hardcoded-key -- <reason>