Skip to content

Commit

Permalink
Fixed #17800 -- Prevented Django from starting without a SECRET_KEY, …
Browse files Browse the repository at this point in the history
…since that opens a variety of security problems. Thanks PaulM for the report.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17611 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
aaugustin committed Mar 1, 2012
1 parent d0f162c commit 4557058
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions django/conf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ def __init__(self, settings_module):
setting_value = (setting_value,) # In case the user forgot the comma.
setattr(self, setting, setting_value)

if not self.SECRET_KEY:
raise ValueError("The SECRET_KEY setting mustn't be empty.")

if hasattr(time, 'tzset') and self.TIME_ZONE:
# When we can, attempt to validate the timezone. If we can't find
# this file, no check happens and it's harmless.
Expand Down

0 comments on commit 4557058

Please sign in to comment.