Here's an unsuccessful attempt to defer the SECRET_KEY check: 
https://code.djangoproject.com/ticket/29324

It seems like it could be insecure to move that to a system check as "For 
performance reasons, checks are not run as part of the WSGI stack that is 
used in deployment." (Also, it seems impossible to write a system check 
that determines whether or not a project will consult SECRET_KEY.)

On Saturday, June 27, 2020 at 6:02:11 PM UTC-4 Adam Johnson wrote:

> There is no reason Django should complain a missing secret key when it 
>> does not need one at all.
>
>
> I agree with this. It is an extra step in making really basic apps that 
> don't use any encryption functionality. IIRC, the "Django needs a secret 
> key" check has always been a custom check rather than a system check mostly 
> because it predates the system check framework. I think we could hoist it 
> to a system check that is triggered only when sessions or other features 
> that depend on it are installed (although I don't know the exhaustive list).
>
> On Sat, 27 Jun 2020 at 22:39, Florian Apolloner <f.apo...@gmail.com> 
> wrote:
>
>> Hi Tom,
>>
>> On Friday, June 26, 2020 at 12:43:19 PM UTC+2 t...@carrick.eu wrote:
>>
>>> I do have a use-case where having a default SECRET_KEY makes things much 
>>> easier - docker.
>>>
>>> Normally you can't run management commands in a Dockerfile if there's no 
>>> secret key (and often other things) set, and usually it's best to run 
>>> collectstatic as a build step.
>>>
>>
>>  I do not see that as an argument for a default SECRET_KEY. Maybe we 
>> should just defer the check for SECRET_KEY till it is accessed? There is no 
>> reason Django should complain a missing secret key when it does not need 
>> one at all.
>>
>> Cheers,
>> Florian
>>
>> -- 
>>
> You received this message because you are subscribed to the Google Groups 
>> "Django developers (Contributions to Django itself)" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-develop...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-developers/83630d2b-f51b-4ec3-b92a-838feb452fa1n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-developers/83630d2b-f51b-4ec3-b92a-838feb452fa1n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
>
> -- 
> Adam
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/a7556768-70de-456d-9b77-40e4311f59f9n%40googlegroups.com.
  • ... Florian Apolloner
  • ... Javier Buzzi
  • ... Adam Johnson
  • ... RenĂ© Fleschenberg
  • ... RenĂ© Fleschenberg
  • ... Florian Apolloner
  • ... Shai Berger
  • ... Tom Carrick
  • ... Florian Apolloner
  • ... Adam Johnson
  • ... Tim Graham
  • ... Florian Apolloner
  • ... Florian Apolloner
  • ... Carlton Gibson
  • ... '1337 Shadow Hacker' via Django developers (Contributions to Django itself)
  • ... 'Aaron C. de Bruyn' via Django developers (Contributions to Django itself)
  • ... Carles Pina i Estany
  • ... Divyesh Khamele
  • ... Kye Russell
  • ... Hadisur Rahman
  • ... '1337 Shadow Hacker' via Django developers (Contributions to Django itself)

Reply via email to