Conclusion there was that environment variables are only one way to go.
(...)
In the discussion it came up that we could prefix the generated SECRET_KEY
with say, `dj::insecure` and then add a deployment system check to ensure
that wasn't used in production. (Paraphrasing various points: might not be
100% robust but would capture most cases.)
So:
* Prefix secret key in project template.
* Add system check to ensure secret key does not have prefix.
--
Ticket URL: <https://code.djangoproject.com/ticket/31757>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* version: 3.0 => master
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/31757#comment:1>
Comment (by René Fleschenberg):
Shai Berger suggested an alternative approach: Marking the string as
insecure by making it an instance of a custom str subclass
(https://groups.google.com/d/msg/django-developers/CIPgeTetYpk/3a0lkAu-
BgAJ). I am not sure which of the two approaches we prefer.
--
Ticket URL: <https://code.djangoproject.com/ticket/31757#comment:2>
* cc: René Fleschenberg (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/31757#comment:3>
* cc: Shai Berger (added)
Comment:
Replying to [comment:2 René Fleschenberg]:
> Shai Berger suggested an alternative approach: Marking the string as
insecure by making it an instance of a custom str subclass
(https://groups.google.com/d/msg/django-developers/CIPgeTetYpk/3a0lkAu-
BgAJ). I am not sure which of the two approaches we prefer.
Prefix is fine, IMO.
--
Ticket URL: <https://code.djangoproject.com/ticket/31757#comment:4>
* owner: nobody => kosc
* status: new => assigned
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/13183 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/31757#comment:5>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/31757#comment:6>
Comment (by Shai Berger):
Replying to [comment:4 felixxm]:
> Replying to [comment:2 René Fleschenberg]:
> > Shai Berger suggested an alternative approach: Marking the string as
insecure by making it an instance of a custom str subclass
>
> Prefix is fine, IMO.
Missed this earlier... prefix is fine IMO too.
--
Ticket URL: <https://code.djangoproject.com/ticket/31757#comment:7>
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/31757#comment:8>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/31757#comment:9>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"b7f500396e05cd1f0bb8901fce16e2d8393d2779" b7f5003]:
{{{
#!CommitTicketReference repository=""
revision="b7f500396e05cd1f0bb8901fce16e2d8393d2779"
Fixed #31757 -- Adjusted system check for SECRET_KEY to warn about
autogenerated default keys.
Thanks Nick Pope, René Fleschenberg, and Carlton Gibson for reviews.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/31757#comment:10>