[1.4] SECRET_KEY deprecation is confusing...

67 views
Skip to first unread message

Nick Pope

unread,
Mar 15, 2012, 10:52:28 AM3/15/12
to django-d...@googlegroups.com
Hi,

There is a problem in 1.4rc2 where a missing SECRET_KEY causes Django to refuse to start.

According to the current version of the release notes on the website: In Django 1.4, starting Django with an empty SECRET_KEY will raise a DeprecationWarning. In Django 1.5, it will raise an exception and Django will refuse to start.

This doesn't make sense...  It currently raises DeprecationWarning which is an exception which causes Django to fail to start.  To trigger a deprecation warning while allowing execution to continue you need to use warnings.warn().

As things stand you are essentially implementing the behaviour for both 1.4 and 1.5!

Cheers,

Nick

Carl Meyer

unread,
Mar 15, 2012, 12:54:24 PM3/15/12
to django-d...@googlegroups.com
On 03/15/2012 07:52 AM, Nick Pope wrote:
> There is a problem in 1.4rc2 where a missing SECRET_KEY causes Django to
> refuse to start.
>
> According to the current version of the release notes on the
> website: *In Django 1.4, starting Django with an empty SECRET_KEY will

> raise a DeprecationWarning. In Django 1.5, it will raise an exception
> and Django will refuse to start.*
> *
> *

> This doesn't make sense... It currently raises DeprecationWarning which
> is an exception which causes Django to fail to start. To trigger a
> deprecation warning while allowing execution to continue you need to use
> warnings.warn().
>
> As things stand you are essentially implementing the behaviour for both
> 1.4 *and* 1.5!

Indeed; thanks for the report. I've now fixed it to use warnings.warn,
as it should have originally.

Carl

signature.asc
Reply all
Reply to author
Forward
0 new messages